Skip to content

Commit

Permalink
ENGCOM-1643: Prevent multiple add-to-cart initializations in case of …
Browse files Browse the repository at this point in the history
…ajax loaded product listing #15409
  • Loading branch information
Stanislav Idolov authored May 25, 2018
2 parents 3003465 + dcab9e9 commit 5d32882
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 5d32882

Please sign in to comment.