Skip to content

Commit dcab9e9

Browse files
ENGCOM-1643: Prevent multiple add-to-cart initializations in case of ajax loaded product listing #15409
- Merge Pull Request #15409 from vovayatsyuk/magento2:fix-multiple-add-to-cart-requests - Merged commits: 1. 502d962
2 parents 7509a5f + 502d962 commit dcab9e9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ define([
3838
_bindSubmit: function () {
3939
var self = this;
4040

41+
if (this.element.data('catalog-addtocart-initialized')) {
42+
return;
43+
}
44+
45+
this.element.data('catalog-addtocart-initialized', 1);
4146
this.element.on('submit', function (e) {
4247
e.preventDefault();
4348
self.submitForm($(this));

0 commit comments

Comments
 (0)