Jump to content

[SOLVED] How to reset a variable on (re-)loading a certain page?


sakiri

Recommended Posts

Hi everybody,

 

on the one-page-checkout page there is a checkbox with name and id "cgv" which as far as I can see is linked to the variable $checkedTOS and placed in some cookie (?).

 

I need to have the "Agree to TOS" checkbox automatically unchecked every time the page is (re-)loaded to avoid queer situations where a customer can check out via paypal without accepting the TOS, and because Austrian (and German, if not EU-wide) statutory provisions require that this acceptance to TOS must not be pre-checked by any means.

Just deleting " {if $checkedTOS}checked="checked"{/if} " as suggested in some other topics does not solve the problem (this is only visual and does not reset the variable/cookie)!

 

I want the variable set to 0 (and if indeed there is a related cookie, this one as well) every time the opc page is called but just can't figure out where and how to achieve this.

 

Any help highly appreciated! Thank you!

Edited by sakiri (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...

I got help with this problem; now it works.

 

This is what had been added:

 

in order-carrier.tpl:

 

in lines 58-64

{if isset($virtual_cart) && !$virtual_cart && $giftAllowed && $cart->gift == 1}
<script type="text/javascript">
{literal}
// <![CDATA[
	$('document').ready( function(){
		if ($('input#gift').is(':checked'))
			$('p#gift_div').show();

there an additional line was added (new line 63):

{if isset($virtual_cart) && !$virtual_cart && $giftAllowed && $cart->gift == 1}
<script type="text/javascript">
{literal}
// <![CDATA[
	$('document').ready( function(){
		alert("ChangeReadyfunction");
		if ($('input#gift').is(':checked'))
			$('p#gift_div').show();

and in /mytheme/js/tools.js:

 

after line 229:

$(document).ready(function() {

this was added:

	var paypalCheckbox = document.getElementById('cgv');
	if (paypalCheckbox != null) {
		updatePaymentMethodsDisplay();
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...