klh6686 Posted May 3, 2010 Share Posted May 3, 2010 similar to the terms of service checkbox, I would like an I am 18 checkbox that has to be checked in order for checkout t continue. What would be the best way to implement this? Link to comment Share on other sites More sharing options...
jtlswanson Posted May 4, 2010 Share Posted May 4, 2010 Ooooh....Bump on this 1! Great idea! Link to comment Share on other sites More sharing options...
rocky Posted May 5, 2010 Share Posted May 5, 2010 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 More sharing options...
jtlswanson Posted May 5, 2010 Share Posted May 5, 2010 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 More sharing options...
rocky Posted May 5, 2010 Share Posted May 5, 2010 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now