madmega Posted May 2, 2014 Share Posted May 2, 2014 Hi, i've noticed that the Terms & Conditions check box stays checked when i reload the page, or when i visit another page and come back. What i need is to let it uncheck when the page is reloaded. I've found this so far: classes/FrontController.phpafter line 94 add this:unset($cookie->checkedTOS); But it doesn't seem to work, and i also found this: 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(); But that also doesn't seem to work...and i simply cannot delete the Terms and Conditions. Link to comment Share on other sites More sharing options...
vekia Posted May 2, 2014 Share Posted May 2, 2014 hello what prestashop version you use? i will check it on the same version Link to comment Share on other sites More sharing options...
madmega Posted May 2, 2014 Author Share Posted May 2, 2014 Hi, prestashop 1.4.8.2 Link to comment Share on other sites More sharing options...
vekia Posted May 2, 2014 Share Posted May 2, 2014 there is a code like <input type="checkbox" name="cgv" id="cgv" value="1" {if $checkedTOS}checked="checked"{/if} /> change it to <input type="checkbox" name="cgv" id="cgv" value="1" /> after that recompile your template (turn off cache and turn on force compile) Link to comment Share on other sites More sharing options...
madmega Posted May 2, 2014 Author Share Posted May 2, 2014 I did this before but it is not working, when i check it, and then refresh, or visit another page and go back to checkout, it is still checked.It has to uncheck.I want the customer to check it every time the page refreshes, and only then show the carrier options. Link to comment Share on other sites More sharing options...
vekia Posted May 2, 2014 Share Posted May 2, 2014 and you also recompiled theme and cleared cache? :| Link to comment Share on other sites More sharing options...
madmega Posted May 2, 2014 Author Share Posted May 2, 2014 Yes i did, but not much changed, only that the checkbox is not checked, and then when i check it, and reload, it stayed checked. Link to comment Share on other sites More sharing options...
gonebdg - webindoshop.com Posted May 3, 2014 Share Posted May 3, 2014 You need JavaScript to do this function uncheckedCgv() { $('#cgv').prop('checked',false); } and don't forget <body onload="uncheckedCgv()"> OR $(window).load(function(){ $('#cgv').prop('checked',false); }); Link to comment Share on other sites More sharing options...
madmega Posted May 6, 2014 Author Share Posted May 6, 2014 I am sorry but this doesn't work, it stays checked. I found a code were it unchecks, but the problem was that the shipping options were still visible.Normally when a customer is inside the order, they have to check the Terms & Conditions check box, and then the carrier options become visible, if they uncheck the Terms & Conditions check box, the carrier options go away.And that is exactly what i want, because there are certain carriers inside the carrier options, that are not available for certain pickup locations, problem is when your refresh the page, those carrier options DO become available for the pickup locations you do not want them to be available in. Link to comment Share on other sites More sharing options...
madmega Posted May 6, 2014 Author Share Posted May 6, 2014 and you also recompiled theme and cleared cache? :| I tried it again with a different browser, the checkbox is unchecked but the carrier options are shown, and they shouldn't when the checkbox is unchecked. 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