djhunlimited Posted August 15, 2010 Share Posted August 15, 2010 During new user registration I would like for the newsletter checkbox to be checked, instead of the user having to manually check it to receive newsletters. This way the user will have to uncheck the box to not receive newsletters when registering a new account.I think something needs added or changed in the authentication.tpl but I may be wrong. I will be grateful for any help Thanks. Link to comment Share on other sites More sharing options...
rocky Posted August 16, 2010 Share Posted August 16, 2010 Change line 134 of authentication.tpl from: <input type="checkbox" name="newsletter" id="newsletter" value="1" {if isset($smarty.post.newsletter) AND $smarty.post.newsletter == 1} checked="checked"{/if} /> to: <input type="checkbox" name="newsletter" id="newsletter" value="1" {if !sizeof($errors) OR (sizeof($errors) AND $smarty.post.newsletter == 1)} checked="checked"{/if} /> Link to comment Share on other sites More sharing options...
fecsó Posted September 30, 2010 Share Posted September 30, 2010 hi rocky,I am beginner in modification but brave enough to try it in my test shop first. Where can I find the authentication.tpl file.Thanksfecsó Link to comment Share on other sites More sharing options...
rocky Posted September 30, 2010 Share Posted September 30, 2010 It is in the themes// directory. Link to comment Share on other sites More sharing options...
adamus007p Posted June 19, 2011 Share Posted June 19, 2011 rocky how to correct it in prestashop 1.4.3 ? Link to comment Share on other sites More sharing options...
maxkdiv Posted June 23, 2011 Share Posted June 23, 2011 same problem, doesn't work in PS 1.4.3 Link to comment Share on other sites More sharing options...
sannie Posted August 16, 2011 Share Posted August 16, 2011 Check out this blog by Willie: http://xbfish.com/tag/prestashop/ worked for me (am using PS 1.4.4)! Link to comment Share on other sites More sharing options...
dulfu Posted August 22, 2012 Share Posted August 22, 2012 There are two places in authentication.tpl where you have to make the changes. after that you have to delete the content of /tools/smarty/compile and tools/smarty/cache. worked for me Cristi Link to comment Share on other sites More sharing options...
aro Posted August 26, 2012 Share Posted August 26, 2012 (edited) Check out this blog by Willie: http://xbfish.com/tag/prestashop/ worked for me (am using PS 1.4.4)! It doesn't work on quick order for quest or new account - it's working only for general shop account registration. How to solve this issue for quick orders? No one knows? Edited September 25, 2012 by aro (see edit history) Link to comment Share on other sites More sharing options...
veronikaaa Posted October 19, 2012 Share Posted October 19, 2012 It´s necessary to make this change in "order-opc-new-account.tpl" too. It will work then. Link to comment Share on other sites More sharing options...
Andreasjj Posted August 3, 2013 Share Posted August 3, 2013 The code in "order-opc-new-account.tpl" is not the same, for me it looks like this: <input type="checkbox" name="newsletter" id="newsletter" value="1" {if isset($guestInformations) && $guestInformations.newsletter}checked="checked"{/if} /> What should i change it to, to make the checkbox checked as standard? Link to comment Share on other sites More sharing options...
vekia Posted August 3, 2013 Share Posted August 3, 2013 instead the {if isset($guestInformations) && $guestInformations.newsletter}checked="checked"{/if} use simple checked="checked" 1 Link to comment Share on other sites More sharing options...
Andreasjj Posted August 3, 2013 Share Posted August 3, 2013 instead the {if isset($guestInformations) && $guestInformations.newsletter}checked="checked"{/if} use simple checked="checked" You mean like this? <input type="checkbox" name="newsletter" id="newsletter" value="1"checked="checked"{/if} /> Link to comment Share on other sites More sharing options...
vekia Posted August 3, 2013 Share Posted August 3, 2013 without {/if} after the "checked" and with space begore checked like this <input type="checkbox" name="newsletter" id="newsletter" value="1" checked="checked"/> 1 Link to comment Share on other sites More sharing options...
Andreasjj Posted August 3, 2013 Share Posted August 3, 2013 without {/if} after the "checked" and with space begore checked like this <input type="checkbox" name="newsletter" id="newsletter" value="1" checked="checked"/> Thank you again! Please have a look at this post in the bottom, and see if you maybe also can help me with that Link to comment Share on other sites More sharing options...
claybourg Posted December 15, 2013 Share Posted December 15, 2013 (edited) The code today is as following <input type="checkbox" name="newsletter" id="newsletter" value="1" {if isset($smarty.post.newsletter) && $smarty.post.newsletter == '1'}checked="checked"{/if} autocomplete="off"/> What is autocomplete="off" ? Should that be removed or stay as below? <input type="checkbox" name="newsletter" id="newsletter" value="1" checked="checked" autocomplete="off" /> Edited December 15, 2013 by claybourg (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted December 15, 2013 Share Posted December 15, 2013 The autocomplete attribute specifies whether or not an input field should have autocomplete enabled. Autocomplete allows the browser to predict the value. When a user starts to type in a field, the browser should display options to fill in the field, based on earlier typed values. Link to comment Share on other sites More sharing options...
chucurulo Posted October 20, 2014 Share Posted October 20, 2014 hi, I made the modification in ps 1.5 worked perfect, but now actualize a 1.6 ps and throws me this errror, can you help me I could not solve it. even change the file to its default state and does not work either. Link to comment Share on other sites More sharing options...
fulviods Posted January 20, 2015 Share Posted January 20, 2015 someone know how to make it work on 1.6 ? Link to comment Share on other sites More sharing options...
jsmit2 Posted January 20, 2015 Share Posted January 20, 2015 (edited) This should work: In the order-opc-new-account.tpl (or the account create template) just replace: <input type="checkbox" name="newsletter" id="newsletter" value="1"{if isset($guestInformations) && isset($guestInformations.newsletter) && $guestInformations.newsletter} checked="checked"{/if} with: <input type="checkbox" name="newsletter" id="newsletter" value="1" checked="checked" autocomplete="off"/> Edited January 20, 2015 by jsmit2 (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted January 20, 2015 Share Posted January 20, 2015 anyway, we have solution but this "checked" by defult thing is agains european union law Link to comment Share on other sites More sharing options...
fulviods Posted January 20, 2015 Share Posted January 20, 2015 We are in Switzerland (but dont know if possible here...) Anyway i made modifications on order-opc-new-account.tpl and authentication.tpl, i cleared the cache of prestashop and browser...but the check box is still unchecked... Link to comment Share on other sites More sharing options...
jsmit2 Posted January 20, 2015 Share Posted January 20, 2015 Hmm what is the htmlcode of the checkbox you get in the browser? Link to comment Share on other sites More sharing options...
jsmit2 Posted January 20, 2015 Share Posted January 20, 2015 Also an option. Add this to the page: <script> $(document).ready(function(){ $('#newsletter').prop('checked', true); }); <script> Link to comment Share on other sites More sharing options...
fulviods Posted January 20, 2015 Share Posted January 20, 2015 <div class="checkbox"> <div class="checker" id="uniform-newsletter"><span><input type="checkbox" value="1" id="newsletter" name="newsletter"></span></div> <label for="newsletter">Inscrivez-vous à notre lettre d'information</label> </div> this is the html code Link to comment Share on other sites More sharing options...
jsmit2 Posted January 20, 2015 Share Posted January 20, 2015 <div class="checkbox"> <div class="checker" id="uniform-newsletter"><span><input type="checkbox" value="1" id="newsletter" name="newsletter"></span></div> <label for="newsletter">Inscrivez-vous à notre lettre d'information</label> </div> this is the html code Hmm. I recommend my javascript/jquery solution. Link to comment Share on other sites More sharing options...
fulviods Posted January 20, 2015 Share Posted January 20, 2015 i added the javascript code just before the code...but it doesnt change anything... :/ do i have to place it in another file? Link to comment Share on other sites More sharing options...
jsmit2 Posted January 21, 2015 Share Posted January 21, 2015 Open the developers console in chrome (F12) do you have any errors? Link to comment Share on other sites More sharing options...
Pammachio Posted February 18, 2015 Share Posted February 18, 2015 Even to me it does not work: we can have a definitive method and it works for version 1.6? thanks Link to comment Share on other sites More sharing options...
SaLiC Posted December 22, 2015 Share Posted December 22, 2015 Where should this be added? <script>$(document).ready(function(){$('#newsletter').prop('checked', true);});<script> 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