fix(backorders): BACK-674 keep PDP backorder row visible when qty exceeds available_to_sell#2672
Merged
Conversation
…eeds available_to_sell When a shopper enters a quantity above available_to_sell, the PDP already surfaces "The maximum purchasable quantity is N" on the Add to Cart button. The "N will be backordered" row was additionally being hidden in that state, which left the shopper without an explanation of why the qty was clamped. Drops the within-sell-limit gate in both the main-product (product-details-base.js) and picklist (picklist-backorder.js) backorder quantity calculations. The backordered line now renders whenever backordered > 0 (still clamped by available_for_backorder), independent of whether the requested qty is within the sell limit. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
bc-maksym-konohorov
approved these changes
Jun 3, 2026
Meztimuro
approved these changes
Jun 3, 2026
agchan12
approved these changes
Jun 3, 2026
animesh1987
approved these changes
Jun 3, 2026
rtalvarez
approved these changes
Jun 4, 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.
What?
Screen.Recording.2026-06-03.at.13.23.13.mov
When a shopper on the storefront PDP enters a quantity that exceeds
available_to_sell, the PDP already surfaces the existing "The maximum purchasable quantity is N" error on the Add to Cart button. Previously, the "N will be backordered" row was also hidden in this state — leaving the shopper without any explanation of how many of the requested qty would be backordered or why the qty was clamped.This change drops the within-sell-limit gate in both the main-product and picklist backorder quantity calculations. The backordered line now renders whenever
backordered > 0, still clamped byavailable_for_backorderfor non-unlimited products, independent of whether the requested qty is within the sell limit.Files changed:
assets/js/theme/common/product-details-base.js—updateQtyBackorderedMessage: removed thewithinSellLimitgate. The row now renders wheneverbackordered > 0.assets/js/theme/common/picklist-backorder.js—buildLines: removed thewithinSellLimitearly-return so each picklist line continues to render when the main qty exceeds that sub-product's ATS (still clamped by itsavailable_for_backorder).assets/js/test-unit/theme/common/picklist-backorder.spec.js— updated the "skip when qty exceeds ATS" test to assert the line now renders with the clamped backorder count instead. All 27 tests pass.CHANGELOG.md— Draft entry added.Requirements
Tickets / Documentation
Note: independent of BACK-637 / PR #2671 (unlimited_backorder support). Both target the same gate and may produce a small merge conflict depending on merge order; either can merge first.
Screenshots (if appropriate)
N/A — UI behavior change verified by setting qty above ATS on a backorderable product and confirming both the "maximum purchasable quantity" error and the "N will be backordered" row are visible together.
Test plan
available_for_backorder).🤖 Generated with Claude Code
Note
Low Risk
Storefront-only display logic for backorder messaging; add-to-cart limits for available_to_sell are unchanged.
Overview
When shoppers enter a quantity above
available_to_sellon the PDP, the theme still shows the maximum purchasable quantity error on Add to Cart (unchanged). This PR stops hiding the "N will be backordered" row in that situation.Main product:
updateQtyBackorderedMessageno longer requires qty to be within the sell limit; the backorder message appears whenever the computed backorder count is > 0, still capped byavailable_for_backorder.Picklist options:
PicklistBackorder.buildLinesdrops the same sell-limit early return so bundled picklist lines stay visible when main qty exceeds a sub-product's ATS, with the same backorder clamping.Unit test and CHANGELOG draft updated accordingly.
Reviewed by Cursor Bugbot for commit 0850c89. Bugbot is set up for automated code reviews on this repo. Configure here.