Skip to content

Commit 1206e78

Browse files
committed
change for : Prevent multiple add-to-cart initializations in case of ajax loaded product listing
1 parent 79613c0 commit 1206e78

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

app/code/Magento/Catalog/view/frontend/web/js/catalog-add-to-cart.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ define([
3333

3434
_bindSubmit: function() {
3535
var self = this;
36+
if (this.element.data('catalog-addtocart-initialized')) {
37+
return;
38+
}
39+
this.element.data('catalog-addtocart-initialized', 1);
3640
this.element.on('submit', function(e) {
3741
e.preventDefault();
3842
self.submitForm($(this));

0 commit comments

Comments
 (0)