Skip to content

Commit 3b636d6

Browse files
authored
Set Quantity by checking item id
1 parent 4f3c9c5 commit 3b636d6

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

app/code/Magento/Checkout/view/frontend/web/js/view/configure/product-customer-data.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ require([
77

88
var selectors = {
99
qtySelector: '#product_addtocart_form [name="qty"]',
10-
productIdSelector: '#product_addtocart_form [name="product"]'
10+
productIdSelector: '#product_addtocart_form [name="product"]',
11+
itemIdSelector: '#product_addtocart_form [name="item"]'
1112
},
1213
cartData = customerData.get('cart'),
1314
productId = $(selectors.productIdSelector).val(),
15+
itemId = $(selectors.itemIdSelector).val(),
1416
productQty,
1517
productQtyInput,
1618

@@ -40,8 +42,10 @@ require([
4042
return;
4143
}
4244
product = data.items.find(function (item) {
43-
return item['product_id'] === productId ||
44-
item['item_id'] === productId;
45+
if (item['item_id'] == itemId) {
46+
return item['product_id'] === productId ||
47+
item['item_id'] === productId;
48+
}
4549
});
4650

4751
if (!product) {

0 commit comments

Comments
 (0)