feat(backorders): BACK-472 Add backorder availability prompt for complex products#2619
Merged
bc-apostoliuk merged 1 commit intomasterfrom Mar 3, 2026
Merged
feat(backorders): BACK-472 Add backorder availability prompt for complex products#2619bc-apostoliuk merged 1 commit intomasterfrom
bc-apostoliuk merged 1 commit intomasterfrom
Conversation
a5d2686 to
c685187
Compare
There was a problem hiding this comment.
Pull request overview
Adds variant-aware backorder UI support so the “More available for backorder” prompt and backordered-quantity message can be updated for complex (variant) products via option-change responses.
Changes:
- Inline-renders a
data-backorder-promptspan inproduct-view.html(and removes the separate partial) so the prompt element always exists in the DOM. - Injects
backorderAvailabilityPromptinto the page JS context. - Extends
ProductDetailsBaseto sync prompt text from option-change data and dynamically show/hide the backorder prompt on variant selection.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| templates/components/products/product-view.html | Always renders the backorder prompt span and injects backorderAvailabilityPrompt for JS use. |
| templates/components/products/backorder-availability-prompt.html | Removes the now-unneeded partial template. |
| assets/js/theme/common/product-details-base.js | Adds a viewModel reference to the prompt element, updates backorder context, and toggles prompt visibility during updateView(). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…lex products Enable the backorder availability prompt and quantity message for products with variants by dynamically updating backorder context from the option-change API response. Made-with: Cursor
c685187 to
b7f2bcb
Compare
animesh1987
approved these changes
Mar 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Jira: BACK-472
What/Why?
The backorder availability prompt ("More available for backorder") and the dynamic backordered quantity message were only working for simple products. For complex products (products with variants), the prompt element was not rendered in the DOM, and the JS had no way to update backorder context when a variant was selected.
This PR:
product-view.html(removing the separatebackorder-availability-prompt.htmlpartial) and always renders thedata-backorder-promptspan so JS can target itavailableToSell,showBackorderAvailabilityPrompt,backorderAvailabilityPrompt,quantityBackorderedMessage) into the JS contextupdateBackorderContext()to sync variant-level backorder data from the option-change API response into the contextupdateBackorderPrompt()to dynamically show/hide the "(More available for backorder)" prompt based on the selected variant's inventoryupdateQtyBackorderedMessage()with sell-limit checks, DOM stock fallback, localized messages, andshowBackorderAvailabilityPromptguardupdateView()so they fire on every option changeRollout/Rollback
Standard deployment. Rollback by reverting the PR if needed.
Testing
Made with Cursor