Skip to content

Commit 50ff419

Browse files
author
Stanislav Idolov
authored
ENGCOM-1818: [Forwardport] Prevent multiple add-to-cart initializations in case of ajax loaded product listing #15748
2 parents 65d27f5 + 10955cd commit 50ff419

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)