Skip to content

Commit 10955cd

Browse files
ENGCOM-1818: [Forwardport] Prevent multiple add-to-cart initializations in case of ajax loaded product listing #15748
- Merge Pull Request #15748 from vijay-wagento/magento2:2.3-develop-PR-port-15409 - Merged commits: 1. 868c077
2 parents 943e2cd + 868c077 commit 10955cd

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)