Jump to content

How do I add the terms of conditions checkbox one page before the shipping page.


Recommended Posts

Hi Guys,

I have been busy with the following problem for quite some time now, and would really appreciate your help:

For my shop, I skip the shipping page of the checkout process.
However, I would like that my customers still agree with the terms& conditions, meaning that I would like to add this checkbox the page before the shipping part.

Is there anyone who knows how to do this?

Thanks a lot!

Link to comment
Share on other sites

Hi,

you have to move some things from order-carrier.tpl to order-address.tpl

the jscript

type="text/javascript" src="{$content_dir}js/conditions.js"




then you have to change the form action in order-address.tpl and move the smarty code from order-carrier.tpl to order-address.tpl

hope it helps

Link to comment
Share on other sites

Hi Huetty,

Thanks for your quick response.

Would you be able to elaborate a bit more on the above?
I have included the JS file, which looks OK. But the part I don't get done is

then you have to change the form action in order-address.tpl and move the smarty code from order-carrier.tpl to order-address.tpl.


I appreciate your help. An example of the code would be great.
Link to comment
Share on other sites

Hi,

you have to tell the form that he has to execute the jscript before sending the data...

so you have to copy the tag

onsubmit="return acceptCGV('{l ...

in the form action tag

and
then you have to copy the

{if $conditions}

block

both from order-carrier.tpl to the order-address.tpl

Link to comment
Share on other sites

Hi Huetty,

I have been busy with trying the above, but I can't get it done.

My order-address.tpl looks like this:

[removed]
<!--
   var baseDir = '{$base_dir_ssl}';
   var addresses = new Array();
   {foreach from=$addresses key=k item=address}
       addresses[{$address.id_address|intval}] = new Array('{$address.company|addslashes}', '{$address.firstname|addslashes}', '{$address.lastname|addslashes}', '{$address.address1|addslashes}', '{$address.address2|addslashes}', '{$address.postcode|addslashes}', '{$address.city|addslashes}', '{$address.country|addslashes}', '{$address.state|default:''|addslashes}');
   {/foreach}
-->
[removed]
[removed][removed]
[removed][removed]

{capture name=path}{l s='Addresses'}{/capture}
{include file=$tpl_dir./breadcrumb.tpl}

{l s='Addresses'}

{assign var='current_step' value='address'}
{include file=$tpl_dir./order-steps.tpl}
{include file=$tpl_dir./errors.tpl}
{include file=$tpl_dir./thickbox.tpl}

<form action="{$base_dir_ssl}order.php" method="post"<h3 class="condition_title">{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}


etcetera



What do I do wrong?

Thanks for your help!

Link to comment
Share on other sites

  • 4 weeks later...

Try make changes in your code like this:


<input type="checkbox" name="cgv" id="cgv" value="1" {if isset($smarty.post.cgv) AND $smarty.post.cgv == 1 } checked="checked"{/if} />


and in the order.php

function processAddress()
{
   global $cart, $smarty;
   $errors = array();

   if (!isset($_POST['id_address_delivery']) OR !Address::isCountryActiveById(intval($_POST['id_address_delivery'])))
       $errors[] = 'this address is not in a valid area';
//add line something like this
   elseif (!Tools::isSubmit('cgv'))
       $errors[] = Tools::displayError('You do not agree with the terms of service.');

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...