Skip to content

Commit 791f006

Browse files
fix(storefront): BACK-475 Display backorder message on cart page
Add backorder message below quantity controls in cart items when stock_position.backorder_message is available, with null-safe checks. Style the message with zero bottom margin for proper alignment. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 4a26c5e commit 791f006

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

assets/scss/components/stencil/cart/_cart.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,9 @@ $card-preview-zoom-bottom-offset: 6rem;
227227
}
228228
}
229229

230+
.cart-item-backorder-message {
231+
margin-bottom: 0;
232+
}
230233
}
231234

232235
.cart-item-label {

lang/en.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,8 @@
727727
"change_product_options": "Change options for {name}",
728728
"quantity_decrease": "Decrease Quantity of {name}",
729729
"quantity_increase": "Increase Quantity of {name}",
730+
"quantity_backordered": "{quantity} will be backordered",
731+
"quantity_on_hand": "{quantity} ready to ship",
730732
"quantity_error_message":"The quantity should contain only numbers",
731733
"purchase_units": "{quantity, plural, =0{0 units} one {# unit} other {# units}}",
732734
"max_purchase_quantity": "Maximum Purchase:",

templates/components/cart/content.html

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,23 @@ <h2 class="cart-item-name">
137137
</button>
138138
{{/if}}
139139
</div>
140-
140+
{{#if stock_position}}
141+
{{#if ../cart.inventory_settings.show_quantity_on_hand}}
142+
{{#all stock_position.quantity_on_hand stock_position.backorder_message}}
143+
<p class="cart-item-backorder-message">{{lang 'products.quantity_on_hand' quantity=stock_position.quantity_on_hand}}</p>
144+
{{/all}}
145+
{{/if}}
146+
{{#if ../cart.inventory_settings.show_quantity_on_backorder}}
147+
{{#if stock_position.quantity_backordered}}
148+
<p class="cart-item-backorder-message">{{lang 'products.quantity_backordered' quantity=stock_position.quantity_backordered}}</p>
149+
{{/if}}
150+
{{/if}}
151+
{{#if ../cart.inventory_settings.show_backorder_message}}
152+
{{#if stock_position.backorder_message}}
153+
<p class="cart-item-backorder-message">{{stock_position.backorder_message}}</p>
154+
{{/if}}
155+
{{/if}}
156+
{{/if}}
141157
</td>
142158

143159
<td class="cart-item-block cart-item-info">

0 commit comments

Comments
 (0)