Skip to content

Commit

Permalink
disable add to cart until page load
Browse files Browse the repository at this point in the history
  • Loading branch information
sunilit42 committed Feb 7, 2019
1 parent cfc6ea2 commit c09acd8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<button type="submit"
title="<?= /* @escapeNotVerified */ $buttonTitle ?>"
class="action primary tocart"
id="product-addtocart-button">
id="product-addtocart-button" disabled>
<span><?= /* @escapeNotVerified */ $buttonTitle ?></span>
</button>
<?= $block->getChildHtml('', true) ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ define([
$.widget('mage.productValidate', {
options: {
bindSubmit: false,
radioCheckboxClosest: '.nested'
radioCheckboxClosest: '.nested',
addToCartButtonSelector: '.action.tocart'
},

/**
Expand Down Expand Up @@ -41,6 +42,7 @@ define([
return false;
}
});
$(this.options.addToCartButtonSelector).attr('disabled',false);
}
});

Expand Down

0 comments on commit c09acd8

Please sign in to comment.