Skip to content

Commit 095e1f6

Browse files
committed
MAGETWO-44405: Unable to change item cart qty from item configure page
1 parent ec5598b commit 095e1f6

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

app/code/Magento/Catalog/view/frontend/requirejs-config.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ var config = {
1111
relatedProducts: 'Magento_Catalog/js/related-products',
1212
upsellProducts: 'Magento_Catalog/js/upsell-products',
1313
productListToolbarForm: 'Magento_Catalog/js/product/list/toolbar',
14-
tierPrice: 'Magento_Catalog/js/tier-price',
15-
addToCart: 'Magento_Msrp/js/msrp',
1614
catalogGallery: 'Magento_Catalog/js/gallery',
1715
priceBox: 'Magento_Catalog/js/price-box',
1816
priceOptionDate: 'Magento_Catalog/js/price-option-date',

app/code/Magento/Msrp/view/base/web/js/msrp.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ define([
6666

6767
this.popupDOM = $(this.options.popUpAttr)[0];
6868
this.infoPopupDOM = $('[data-role=msrp-info-template]')[0];
69+
$(this.options.cartButtonId).on('click', this._addToCartSubmit.bind(this));
6970

7071
if (this.options.popupId) {
7172
$('body').append($(this.popupDOM).html());
@@ -137,6 +138,29 @@ define([
137138
closePopup: function ($elem) {
138139
$elem.dropdownDialog('close');
139140
$(document).off('mouseup');
141+
},
142+
143+
/**
144+
* Handler for addToCart action
145+
*/
146+
_addToCartSubmit: function () {
147+
this.element.trigger('addToCart', this.element);
148+
149+
if (this.element.data('stop-processing')) {
150+
return false;
151+
}
152+
153+
if (this.options.addToCartButton) {
154+
$(this.options.addToCartButton).click();
155+
156+
return false;
157+
}
158+
159+
if (this.options.addToCartUrl) {
160+
$('.mage-dropdown-dialog > .ui-dialog-content').dropdownDialog('close');
161+
}
162+
$(this.options.cartForm).submit();
163+
140164
}
141165
});
142166

0 commit comments

Comments
 (0)