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

Solved
Pathfinder
120 6 9

@alimcleod  can you share with us your link so we can see it live ? and can you show us the code where you put required

0 Likes
New Member
9 0 0

Hey Emir,

 

My business is not launched yet so the site is password-protected, but here is my customers/register.liquid code - 

 

<div class="page-width">
<div class="grid">
<div class="grid__item medium-up--one-half medium-up--push-one-quarter">

<div class="form-vertical">
{% form 'create_customer' %}

<h1 class="text-center">{{ 'customer.register.title' | t }}</h1>

{%- if form.errors -%}
<div class="form-message form-message--error">
{{ form.errors | default_errors }}
</div>
{%- endif -%}

<label for="FirstName">{{ 'customer.register.first_name' | t }}</label>
<input required type="text" name="customer[first_name]" id="FirstName" {% if form.first_name %}value="{{ form.first_name }}"{% endif %} autofocus>

<label for="LastName">{{ 'customer.register.last_name' | t }}</label>
<input required type="text" name="customer[last_name]" id="LastName" {% if form.last_name %}value="{{ form.last_name }}"{% endif %}>

<label for="Email">{{ 'customer.register.email' | t }}</label>
<input required type="email" name="customer[email]" id="Email" class="{% if form.errors contains 'email' %} input--error{% endif %}" {% if form.email %} value="{{ form.email }}"{% endif %} autocorrect="off" autocapitalize="off">

<label for="CreatePassword">{{ 'customer.register.password' | t }}</label>
<input required type="password" name="customer[password]" id="CreatePassword" class="{% if form.errors contains 'password' %} input--error{% endif %}">

<p style="float: none; text-align: left; clear: both; margin: 10px 0;">
<input required 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="https://cdn.shopify.com/s/files/1/0086/6759/4816/files/Black_Note_Transcriptions_-_Privacy_Policy.pd... and conditions</a>.
</label>
</p>

<p class="text-center">
<input type="submit" value="{{ 'customer.register.submit' | t }}" class="btn">
</p>

{% endform %}
</div>
</div>
</div>
</div>

0 Likes
Pathfinder
120 6 9

Thank You @alimcleod :)

0 Likes
New Member
4 0 0

Hi Sarhov, I've added the coding and follows all the steps, but when clicked button 'Create', it's still prompt as register.

 

I'm using Impulse Theme.

 

Thanks in advance! ;)

0 Likes
Shopify Partner
455 80 100

@Ruzaini_Rahim 

I think you have missed this part

 

 $(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;
      }
    });
  })

 

or it doesn't work as it should, because this part is for TO NOT allow the form submitted, but shown an alert with text'.... You must agree...

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
Highlighted
New Member
4 0 0

Hello,

 

i put the path in the customer/register.liquid and then in the theme.liquid the other part but it wont work?

Cank somebody help me?

0 Likes