Jump to content

I am 18 checkbox before checkout


Recommended Posts

I think it would be best just to use the same checkbox as the conditions and change the label to "I am 18 or over and I agree to the terms and conditions" to avoid modifying code, but if you really want to add another checkbox and don't mind modifying code, change the following code on lines 31-37 of order-carrier.tpl in your theme's directory from:

{if $conditions}
{l s='Terms of service'}


       <input type="checkbox" name="cgv" id="cgv" value="1" {if $checkedTOS}checked="checked"{/if} />
{l s='I agree with the terms of service and I adhere to them unconditionally.'} {l s='(read)'}

{/if}



to:

{if $conditions}
{l s='Terms of service'}


       <input type="checkbox" name="cgv" id="cgv" value="1" {if $checkedTOS}checked="checked"{/if} />
{l s='I agree with the terms of service and I adhere to them unconditionally.'} {l s='(read)'}



       <input type="checkbox" name="eighteen" id="eighteen" value="1" />
{l s='I am 18 years old or over'}

{/if}



and change line 3 of js/conditions.js from:

if (!getE('cgv').checked)



to:

if (!getE('cgv').checked || !getE('eighteen').checked)


[/code]

Link to comment
Share on other sites

Hey Rocky,

Thanks for the reply. My js/conditions.js file has only the following statement in it (nothing like what you've stated):

function acceptCGV(msg)
{
if ($('#cgv').length && !$('input#cgv:checked').length)
{
alert(msg);
return false;
}
else
return true;
}

It is the only js folder that contains the conditions.js file in it. Any ideas?

Thanks again for your reply!

JTLS

Link to comment
Share on other sites

I assumed you were using Prestashop v1.2.5. It looks like you are using v1.3. In that case, change line 3 from:

if ($('#cgv').length && !$('input#cgv:checked').length)



to:

if (($('#cgv').length && !$('input#cgv:checked').length) || ($('#eighteen').length && !$('input#eighteen:checked').length))

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...