Adding a T&C's checkbox upon customer registration (not cart page)

Solved
New Member
9 0 0

Hello!

 

I would like to add a T&C's checkbox on my customer registration page so that customers have to agree before creating an account. Could anybody help with this?

0 Likes
Shopify Partner
455 80 98
Here is the tutorial for cart page, you can adjust it for your contact form. https://help.shopify.com/en/themes/customization/cart/add-terms-and-conditions-checkbox
Author: Hovhannes Sargsyan (aka sarhov).
An individual web developer focused on Shopify development.
Need more help? Feel free to send me a direct message or drop an email shopify@sarhov.com

Website: https://sarhov.com  
Email: shopify@sarhov.com
Skype: @sarhov
Messenger: @sarhov
Telegram: @sarhov
0 Likes
New Member
9 0 0

Thank you for your response sarhov! I am not sure of the steps I would need to take in order to modify the code to add the member registration page. Do you know what would differ from the tutorial you linked to?

0 Likes
Shopify Partner
455 80 98

Can't you say which theme you're using ?

Author: Hovhannes Sargsyan (aka sarhov).
An individual web developer focused on Shopify development.
Need more help? Feel free to send me a direct message or drop an email shopify@sarhov.com

Website: https://sarhov.com  
Email: shopify@sarhov.com
Skype: @sarhov
Messenger: @sarhov
Telegram: @sarhov
0 Likes
New Member
9 0 0

I'm using debut.

0 Likes

Success.

Shopify Partner
455 80 98

Go into edit code, then find theme.js, scroll at the very bottom and the following code there.

  $(document).ready(function() {
    $('body').on('click', '#RegisterForm .btn', function() {
      if ($('#agree').is(':checked')) {
        $(this).submit();
      }
      else {
        alert("You must agree with the terms and conditions of sales to check out.");
        return false;
      }
    });
  });

Your result file should looks like this

xCCUGa6
Then find file 'customers/register.liquid' and there past the following code above the submit button

code;

        <p style="float: none; text-align: left; clear: both; margin: 10px 0;">
  <input style="float:none; vertical-align: middle; margin:0; margin-right: 6px;" type="checkbox" id="agree" />
  <label style="display:inline; float:none" for="agree">
    I agree with the <a href="/pages/terms-and-conditions">terms and conditions</a>.
  </label>
</p>

After it should looks like this
JLrWL3d

After all this in register page you should see the following.

eiqBz4s.gif

 

By the way, you can change page url of your terms and condition page in url of second snippet.

I agree with the <a href="/pages/terms-and-conditions">terms and conditions</a>.

 

 

Author: Hovhannes Sargsyan (aka sarhov).
An individual web developer focused on Shopify development.
Need more help? Feel free to send me a direct message or drop an email shopify@sarhov.com

Website: https://sarhov.com  
Email: shopify@sarhov.com
Skype: @sarhov
Messenger: @sarhov
Telegram: @sarhov
0 Likes
New Member
9 0 0

Thank you very much!! That worked but I would like to make it mandatory so that if a customer doesn't check the box, they can't create an account. Would you know how to do that? Thanks again for your help - I very much appreciate it!

0 Likes
Pathfinder
120 6 6

@alimcleod 

a better idea

why not just add a text under the button like :

By joining, you agree to our

Privacy Police & Term of Service

with out a checkbox just the text is enough in my opinion   what do you think ? 

0 Likes
New Member
9 0 0

Thank you Emir, that would suffice, but I would rather have the checkbox and the instructions above worked perfectly - the only thing is making it mandatory.

0 Likes
New Member
9 0 0

I added the word "required" after "input" and that made the box mandatory, thanks for all your help!

0 Likes