Cart - Add an 'Agree to terms and conditions' checkbox

mc9745
Tourist
3 0 1

Hello

He is currently using the Narrative theme.

I have managed to configure in cart-drawer.liquid the checkbox agree with the Terms and Conditions, but I want to make it requiered.


1º) The following code has been put in Assets / Theme.js:

  $(document).ready(function() {
    $('body').on('click', '[name="checkout"], [name="goto_pp"], [name="goto_gc"]', function() {
      if ($('#agree').is(':checked')){
        $(this).submit();
      }
     
        alert("You must agree with the terms and conditions of sales to check out.");
        return false;
      }
    });
  });

2º) In both cart-drawer.liquid and cart-template.liquid:

<p style="float: none; text-align: leaft; clear: both; margin: 10px 0;">
  <input style="float:none; vertical-align: middle;" type="checkbox" id="agree" />
  <label style="display:inline; float:none" for="agree">
    Estoy de acuerdo con los <a href="/pages/terminos-y-condiciones">términos y condiciones</a>.
  </label>
</p>

 

But I can't get the box required

HELPPPP!!!!!

Thanks in advance

0 Likes
hardik355
Shopify Partner
36 3 5

hi  

i think this link is very usefully.

https://www.huratips.com/tech-tips/how-to-add-an-agree-to-terms-and-conditions-checkbox-to-shopify-c...
https://community.shopify.com/c/Shopify-Design/Cart-Add-an-Agree-to-terms-and-conditions-checkbox/td...

If you have questions, just let me know.
Please Contact Skype: live:hardikradadiya355
E-mail: psams7803@gmail.com
Thanks

0 Likes
mc9745
Tourist
3 0 1

Hello,
Thank you very much for your answer,
I already have the checkbox configured.

I need help to put it required, and that to go to the next step is only possible by checking the box

Madara
New Member
1 0 1

I'am in the same position. 

I have made check box, but people can get in without check it..... 

mc9745
Tourist
3 0 1

Hello Mariana, I've been looking for a solution for two weeks but I can't find anywhere how to solve it. My company has hired a company certified by shopify, which charges us € 65 to do so. What do you think if we divide the expense between the two and ask them to do it in your store as well, since it is the same problem.
It would be € 32.5.

How about?

0 Likes
Satyajit
Shopify Partner
2 0 0

Might be some javascript issues, are you getting an errors. I can take a quick look if you can share your store details. 

0 Likes