Skip to content

Commit d8d51e9

Browse files
committed
Display Wrong Data On Cart Update Page
1 parent 3b636d6 commit d8d51e9

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

app/code/Magento/Catalog/view/frontend/templates/product/view/form.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<input type="hidden" name="product" value="<?= /* @escapeNotVerified */ $_product->getId() ?>" />
2323
<input type="hidden" name="selected_configurable_option" value="" />
2424
<input type="hidden" name="related_product" id="related-products-field" value="" />
25-
<input type="hidden" name="item" value="<?= $block->getRequest()->getParam('id') ?>" />
25+
<input type="hidden" name="item" value="<?= /* @noEscape */ $block->getRequest()->getParam('id') ?>" />
2626
<?= $block->getBlockHtml('formkey') ?>
2727
<?= $block->getChildHtml('form_top') ?>
2828
<?php if (!$block->hasOptions()):?>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ require([
4242
return;
4343
}
4444
product = data.items.find(function (item) {
45-
if (item['item_id'] == itemId) {
45+
if (item['item_id'] === itemId) {
4646
return item['product_id'] === productId ||
4747
item['item_id'] === productId;
4848
}

app/code/Magento/ConfigurableProduct/view/frontend/web/js/options-updater.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ define([
88
var selectors = {
99
formSelector: '#product_addtocart_form',
1010
productIdSelector: '#product_addtocart_form [name="product"]',
11-
itemIdSelector:'#product_addtocart_form [name="item"]'
11+
itemIdSelector: '#product_addtocart_form [name="item"]'
1212
},
1313
cartData = customerData.get('cart'),
1414
productId = $(selectors.productIdSelector).val(),
15-
itemId= $(selectors.itemIdSelector).val(),
15+
itemId = $(selectors.itemIdSelector).val(),
1616

1717
/**
1818
* set productOptions according to cart data from customer-data
@@ -27,7 +27,7 @@ define([
2727
return false;
2828
}
2929
changedProductOptions = data.items.find(function (item) {
30-
if (item['item_id'] == itemId) {
30+
if (item['item_id'] === itemId) {
3131
return item['product_id'] === productId;
3232
}
3333
});

0 commit comments

Comments
 (0)