Skip to content

Commit 572af81

Browse files
committed
MAGETWO-97580: Update configurable in the cart. We can't find a quote item
1 parent b3abf20 commit 572af81

File tree

3 files changed

+28
-8
lines changed

3 files changed

+28
-8
lines changed

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

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ define([
7373
this.initTierPopup();
7474
}
7575
$(this.options.cartButtonId).on('click', this._addToCartSubmit.bind(this));
76+
$(this.options.cartForm).on('submit', this._onSubmitForm.bind(this));
7677
},
7778

7879
/**
@@ -249,8 +250,10 @@ define([
249250

250251
/**
251252
* Handler for addToCart action
253+
*
254+
* @param {Object} e
252255
*/
253-
_addToCartSubmit: function () {
256+
_addToCartSubmit: function (e) {
254257
this.element.trigger('addToCart', this.element);
255258

256259
if (this.element.data('stop-processing')) {
@@ -266,8 +269,20 @@ define([
266269
if (this.options.addToCartUrl) {
267270
$('.mage-dropdown-dialog > .ui-dialog-content').dropdownDialog('close');
268271
}
272+
273+
e.preventDefault();
269274
$(this.options.cartForm).submit();
275+
},
270276

277+
/**
278+
* Handler for submit form
279+
*
280+
* @private
281+
*/
282+
_onSubmitForm: function () {
283+
if ($(this.options.cartForm).valid()) {
284+
$(this.options.cartButtonId).prop('disabled', true);
285+
}
271286
}
272287
});
273288

app/code/Magento/ProductVideo/view/frontend/web/js/fotorama-add-video-events.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,14 @@ define([
179179
* @private
180180
*/
181181
clearEvents: function () {
182-
this.fotoramaItem.off(
183-
'fotorama:show.' + this.PV +
184-
' fotorama:showend.' + this.PV +
185-
' fotorama:fullscreenenter.' + this.PV +
186-
' fotorama:fullscreenexit.' + this.PV
187-
);
182+
if (this.fotoramaItem !== undefined) {
183+
this.fotoramaItem.off(
184+
'fotorama:show.' + this.PV +
185+
' fotorama:showend.' + this.PV +
186+
' fotorama:fullscreenenter.' + this.PV +
187+
' fotorama:fullscreenexit.' + this.PV
188+
);
189+
}
188190
},
189191

190192
/**

app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1248,7 +1248,10 @@ define([
12481248
}
12491249

12501250
imagesToUpdate = this._setImageIndex(imagesToUpdate);
1251-
gallery.updateData(imagesToUpdate);
1251+
1252+
if (!_.isUndefined(gallery)) {
1253+
gallery.updateData(imagesToUpdate);
1254+
}
12521255

12531256
if (isInitial) {
12541257
$(this.options.mediaGallerySelector).AddFotoramaVideoEvents();

0 commit comments

Comments
 (0)