Skip to content

Commit 777a291

Browse files
authored
Merge pull request #861 from tblivet/fix/min-quantity-alert-cart
Fix the minimum quantity alert message in the cart
2 parents f7199e5 + fdee4bb commit 777a291

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

src/js/components/useQuantityInput.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,11 @@ const updateQuantity = async (qtyInputGroup: Theme.QuantityInput.InputGroup, cha
168168

169169
if (data.hasError) {
170170
const errors = data.errors as Array<string>;
171-
const productAlertSelector = resetAlertContainer(qtyInput);
171+
const cartAlertSelector = cartSelectorMap.alertPlaceholder;
172172

173-
if (errors && productAlertSelector) {
173+
if (errors && cartAlertSelector) {
174174
errors.forEach((error: string) => {
175-
useAlert(error, {type: 'danger', selector: productAlertSelector}).show();
175+
useAlert(error, {type: 'danger', selector: cartAlertSelector}).show();
176176
});
177177
}
178178
} else {

templates/checkout/_partials/cart-detailed-product-line.tpl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
*}
55

66
<div class="product-line">
7-
{assign var=product_line_alert_id value=10|mt_rand:100000}
8-
<div class="visually-hidden" id="js-product-line-alert--{$product_line_alert_id}"></div>
9-
107
<div class="product-line__image">
118
<a class="product-line__title product-line__item" href="{$product.url}"
129
data-id_customization="{$product.id_customization|intval}">
@@ -129,7 +126,6 @@
129126
"name"=>"product-quantity-spin",
130127
"data-update-url"=>"{$product.update_quantity_url}",
131128
"data-product-id"=>"{$product.id_product}",
132-
"data-alert-id"=>"{$product_line_alert_id}",
133129
"value"=>"{$product.quantity}",
134130
"min"=>"{$product.minimal_quantity}"
135131
]

0 commit comments

Comments
 (0)