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.


  • Have you tried anything from your side? Jun 21, 2017 at 9:16
  • yes i have done it.. look @ Answer. Jun 21, 2017 at 10:18

1 Answer 1


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 ($) {
        if (jQuery('.control #add_to_cart').is(':checked') === false) {
                    alert("Please check at least one item");
                    return false;


and it's work..! try it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.