Skip to content

feat(backorders): BACK-470 add backorder availability prompt for complex products#2610

Draft
bc-apostoliuk wants to merge 5 commits intomasterfrom
BACK-470
Draft

feat(backorders): BACK-470 add backorder availability prompt for complex products#2610
bc-apostoliuk wants to merge 5 commits intomasterfrom
BACK-470

Conversation

@bc-apostoliuk
Copy link
Contributor

@bc-apostoliuk bc-apostoliuk commented Feb 17, 2026

Jira: BACK-470

What/Why?

Screenshot 2026-02-17 at 15 03 10

Complex products (with variants/options) did not dynamically update the backorder availability prompt when a shopper changed product options. This PR adds that support by:

  1. Backorder prompt for complex products — Injects product-level backorder config (showBackorderAvailabilityPrompt, backorderAvailabilityPrompt) into the JS context and wraps the prompt element in a data-backorder-prompt container. The updateView method now dynamically shows/hides the prompt based on variant stock data when options change, mirroring the existing simple product Handlebars behavior.

  2. Fix disabled quantity controls on products with empty attributes — The updateDefaultAttributesForOOS method was using loose falsy checks (!data.purchasable || !data.instock) which treated undefined the same as false. When window.BCData.product_attributes returned an empty object, this incorrectly disabled the quantity controls and Add to Cart button. Changed to strict equality (=== false) so controls are only disabled when the API explicitly reports the product as not purchasable or out of stock.

Rollout/Rollback

Standard deployment. Rollback by reverting the PR if needed.

Testing

  1. Backorder prompt (complex product):

    • Navigate to a complex product (with variants) that has backorder enabled and a backorder availability prompt configured
    • Change variant options and verify the backorder prompt shows/hides dynamically based on the selected variant's stock level
    • Verify the prompt text matches the configured backorder availability message
  2. Backorder prompt (simple product):

    • Navigate to a simple product with backorder enabled — verify the prompt still renders correctly (no regression)
  3. Quantity controls fix:

    • Navigate to a product where window.BCData.product_attributes is an empty object (e.g., a sample product without full configuration)
    • Verify the quantity increment/decrement buttons and Add to Cart button are not incorrectly disabled
  4. Out-of-stock behavior:

    • Navigate to a product that is explicitly out of stock or not purchasable
    • Verify the quantity controls and Add to Cart button are still correctly disabled

Made with Cursor

bc-apostoliuk and others added 2 commits February 17, 2026 14:59
…lex products

- Dynamically show/hide backorder availability prompt when variant
  options change on complex products, mirroring the existing simple
  product behavior
- Inject product-level backorder config into JS context and update
  the prompt in updateView based on variant stock data
- Fix updateDefaultAttributesForOOS disabling controls when product
  attributes data is empty (undefined !== false)

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…ewModel

Co-authored-by: Cursor <cursoragent@cursor.com>
@bc-apostoliuk bc-apostoliuk marked this pull request as draft February 17, 2026 13:39
…romptContainer

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments