Skip to content

Commit 5d32882

Browse files
author
Stanislav Idolov
authored
ENGCOM-1643: Prevent multiple add-to-cart initializations in case of ajax loaded product listing #15409
2 parents 3003465 + dcab9e9 commit 5d32882

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)