Skip to content

Commit 1fcd1a4

Browse files
ENGCOM-1848: [Backport] Prevent multiple add-to-cart initializations in case of ajax loaded product listing #15801
- Merge Pull Request #15801 from viral-wagento/magento2:feature-fix-multiple-add-to-cart-requests - Merged commits: 1. 1206e78
2 parents 79613c0 + 1206e78 commit 1fcd1a4

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)