Skip to content

Commit

Permalink
ENGCOM-1818: [Forwardport] Prevent multiple add-to-cart initializatio…
Browse files Browse the repository at this point in the history
…ns 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
  • Loading branch information
magento-engcom-team committed Jun 4, 2018
2 parents 943e2cd + 868c077 commit 10955cd
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ define([
_bindSubmit: function () {
var self = this;

if (this.element.data('catalog-addtocart-initialized')) {
return;
}

this.element.data('catalog-addtocart-initialized', 1);
this.element.on('submit', function (e) {
e.preventDefault();
self.submitForm($(this));
Expand Down

0 comments on commit 10955cd

Please sign in to comment.