Skip to content

Commit 9e74d69

Browse files
authored
ENGCOM-4178: disable add to cart until page load #21007
2 parents 3a46d6b + 6566d3c commit 9e74d69

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

app/code/Magento/Catalog/view/frontend/templates/product/view/addtocart.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<button type="submit"
3333
title="<?= /* @escapeNotVerified */ $buttonTitle ?>"
3434
class="action primary tocart"
35-
id="product-addtocart-button">
35+
id="product-addtocart-button" disabled>
3636
<span><?= /* @escapeNotVerified */ $buttonTitle ?></span>
3737
</button>
3838
<?= $block->getChildHtml('', true) ?>

app/code/Magento/Catalog/view/frontend/web/js/validate-product.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ define([
1313
$.widget('mage.productValidate', {
1414
options: {
1515
bindSubmit: false,
16-
radioCheckboxClosest: '.nested'
16+
radioCheckboxClosest: '.nested',
17+
addToCartButtonSelector: '.action.tocart'
1718
},
1819

1920
/**
@@ -41,6 +42,7 @@ define([
4142
return false;
4243
}
4344
});
45+
$(this.options.addToCartButtonSelector).attr('disabled', false);
4446
}
4547
});
4648

0 commit comments

Comments
 (0)