sakiri Posted October 13, 2013 Share Posted October 13, 2013 (edited) 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 October 21, 2013 by sakiri (see edit history) Link to comment Share on other sites More sharing options...
PascalVG Posted October 13, 2013 Share Posted October 13, 2013 You could use something like <script> $(document).ready(function(){ reset your variable here... }); </script> where you set the variable when the page is loaded. search for $(document).ready for more info... pascal Link to comment Share on other sites More sharing options...
sakiri Posted October 21, 2013 Author Share Posted October 21, 2013 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 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