In a Product Detail Page after Quantity add checkbox when checkbox button is checked than "add to cart" button stay active if not click on checkbox than disable button.
Thanks,
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityIn a Product Detail Page after Quantity add checkbox when checkbox button is checked than "add to cart" button stay active if not click on checkbox than disable button.
Thanks,
I have override the in custom theme file addtocart.phtml file after qty box i have added a checkbox. like
<input type="checkbox" name="add_to_cart" id="add_to_cart">
after that at the end of the page i have add custom jquery for check box is checked or not..! like
<script type="text/javascript">
require(['jquery'], function ($) {
jQuery(".tocart").click(function(){
if (jQuery('.control #add_to_cart').is(':checked') === false) {
alert("Please check at least one item");
return false;
}
});
});
</script>
and it's work..! try it.