Skip to content

Commit

Permalink
Prevent multiple add-to-cart initializations in case of ajax loaded c…
Browse files Browse the repository at this point in the history
…ontent
  • Loading branch information
vovayatsyuk authored and vijay-wagento committed Jun 4, 2018
1 parent 943e2cd commit 868c077
Showing 1 changed file with 5 additions and 0 deletions.
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 868c077

Please sign in to comment.