brianburt Posted August 6, 2009 Share Posted August 6, 2009 When a customer tries to create a new account there is no field for confirming the password choice. I am sure I must be missing something in configuring my installation.Can someone suggest how I can make sure that the password is confirmed on creation of new accounts?Thanks Link to comment Share on other sites More sharing options...
TropischBruin Posted August 7, 2009 Share Posted August 7, 2009 This is a must have I guess. Link to comment Share on other sites More sharing options...
brianburt Posted August 7, 2009 Author Share Posted August 7, 2009 Yes a must have. This forum makes you confirm your password when you register but Prestashop does not. Since the online demo does exactly the same thing as my installation I am assumeing this is an oversight?Next question then is when will this be fixed? Link to comment Share on other sites More sharing options...
Joël Gaujard Posted October 27, 2009 Share Posted October 27, 2009 Hello,I made a little script for this feature. Please test it and say me if it works on your project. {l s='Confirm password'} <input type="password" class="text" name="passwd_confirm" id="passwd_confirm" /> * [removed] $(function(){ldelim} $("#passwd_confirm").parents("form").submit(function(){ldelim} if ($('#passwd').attr('value') == $('#passwd_confirm').attr('value')) return true; alert("{l s='Yours both passwords filled in do not match.'}"); return false; {rdelim}); {rdelim}); [removed] 1 Link to comment Share on other sites More sharing options...
exadra37 Posted October 28, 2009 Share Posted October 28, 2009 What is the file to put this code?Do you know anything to confirm de client registation by email?Thanks Link to comment Share on other sites More sharing options...
Joël Gaujard Posted October 28, 2009 Share Posted October 28, 2009 You can put this code in the file /themes//authentication.tpl just below the classic password input field.About subscription confirmation by mail, you have to install a module for this. like : http://www.prestastore.com/fonctionnalites-front-office/234-fonctionnalites-front-office-activation-par-mail.html Link to comment Share on other sites More sharing options...
exadra37 Posted October 28, 2009 Share Posted October 28, 2009 thanks for the tip I will try to do that and see if it works for me. Link to comment Share on other sites More sharing options...
Joël Gaujard Posted October 28, 2009 Share Posted October 28, 2009 You're welcome. Say me if it works well on your project.You have to remplace "[removed]" by < script type="text/javascript"> and the last by </script> But remove the blank space where it has to. Link to comment Share on other sites More sharing options...
exadra37 Posted October 29, 2009 Share Posted October 29, 2009 It works but i have to guess what you are say about remove blank space....I think it is better for the next people to have the code correct.... In Themes/Prestashop/Autenthication.tpl insert in line 118 the following code: {l s='Confirm password'} <input type="password" class="text" name="passwd_confirm" id="passwd_confirm" /> * [removed] $(function(){ldelim} $("#passwd_confirm").parents("form").submit(function(){ldelim} if ($('#passwd').attr('value') == $('#passwd_confirm').attr('value')) return true; alert("{l s='Yours both passwords filled in do not match.'}"); return false; {rdelim}); {rdelim}); [removed] Many thanks to you for this :-) Link to comment Share on other sites More sharing options...
Joël Gaujard Posted October 29, 2009 Share Posted October 29, 2009 I did this because tag nammed script are qutomatically removed (like you :-S ) Link to comment Share on other sites More sharing options...
exadra37 Posted October 29, 2009 Share Posted October 29, 2009 Sorry i don´t have notice that.... why that happens?It is a bad :-S Link to comment Share on other sites More sharing options...
Joël Gaujard Posted October 29, 2009 Share Posted October 29, 2009 Because the forum automaticcaly removed this tag...It's not your fault. Link to comment Share on other sites More sharing options...
rocky Posted October 30, 2009 Share Posted October 30, 2009 You can avoid this happening by entering <script type="text/javascript"> and </script> like this: {l s='Confirm password'} <input type="password" class="text" name="passwd_confirm" id="passwd_confirm" /> * <script type="text/javascript"> $(function(){ldelim} $("#passwd_confirm").parents("form").submit(function(){ldelim} if ($('#passwd').attr('value') == $('#passwd_confirm').attr('value')) return true; alert("{l s='Yours both passwords filled in do not match.'}"); return false; {rdelim}); {rdelim}); </script> 1 Link to comment Share on other sites More sharing options...
Joël Gaujard Posted October 30, 2009 Share Posted October 30, 2009 Thanks you Rocky !Did you test it ? If so, did it works well ? Link to comment Share on other sites More sharing options...
rocky Posted October 30, 2009 Share Posted October 30, 2009 I just tested your code in IE8 and it worked perfectly. Link to comment Share on other sites More sharing options...
Patric Posted October 30, 2009 Share Posted October 30, 2009 Has this been posted into the Feature Request ? Link to comment Share on other sites More sharing options...
rocky Posted October 30, 2009 Share Posted October 30, 2009 Yes, there is a feature request here. Link to comment Share on other sites More sharing options...
Joël Gaujard Posted October 30, 2009 Share Posted October 30, 2009 Hello,PrestaTeam don't want to integrate this features into the solution. When i was in the company, they answer : the form should be shorter that possible.I think this feature need to be option in BO....Maybe in the second version of PS Link to comment Share on other sites More sharing options...
lhphan Posted June 1, 2010 Share Posted June 1, 2010 Hi,Are you guys sure the code works.I tested the solution and ran into two problems.1) Dreamweaver tells me that $("passwd_confirm").parents("form").submit(function(){ldelim});has a syntax error.2) If I ignore number 1) The input field for "password confirmation" will be there during registration but even if the passwords don't match the registration process continues. Link to comment Share on other sites More sharing options...
Joël Gaujard Posted June 1, 2010 Share Posted June 1, 2010 Hi Iphan,1) If think Dreamweaver don't understand javascript code with jQuery syntax. And your syntax is not good, missing "{rdelim}" at the end, before ");". Please copy/paste correctly code of this thread.2) I don't know why, but if your javascript is not good certainly it don't works.Have you got javascript error in your browser ? Link to comment Share on other sites More sharing options...
lhphan Posted June 1, 2010 Share Posted June 1, 2010 Hi Joel,Thanks for replying. I did copy/paste the exact code that you posted. Like I said before, it will run but there it does not check if the passwords match. I have tested on 3 different browsers. The code does not stop me from registering even if the passwords don't match.I linked a screenshot below so you can see what I mean.http://www.mediafire.com/imgbnc.php/5b6e3663121199150f31ea5e92e0758d6g.jpg Link to comment Share on other sites More sharing options...
shahriar Posted June 5, 2010 Share Posted June 5, 2010 You can avoid this happening by entering <script type="text/javascript"> and </script> like this: {l s='Confirm password'} <input type="password" class="text" name="passwd_confirm" id="passwd_confirm" /> * <script type="text/javascript"> $(function(){ldelim} $("#passwd_confirm").parents("form").submit(function(){ldelim} if ($('#passwd').attr('value') == $('#passwd_confirm').attr('value')) return true; alert("{l s='Yours both passwords filled in do not match.'}"); return false; {rdelim}); {rdelim}); </script> Million Tnx It'working well in firefox,safari , actually i could to test on these browser Link to comment Share on other sites More sharing options...
TonyH Posted September 23, 2010 Share Posted September 23, 2010 Hi Rock/Joël,I have tried using this script with IE8, but it constantly says the passwords do not match, even though they do. In addition to the code is there something else I should be doing?Many thanks Link to comment Share on other sites More sharing options...
Joël Gaujard Posted September 23, 2010 Share Posted September 23, 2010 Hello TonyH,Sorry I cannot test on IE8. Maybe someone else can help you... Sorry.Regards,Joel Link to comment Share on other sites More sharing options...
TonyH Posted September 23, 2010 Share Posted September 23, 2010 Joël,Thanks for your reply. I have now tested it in Firefox and Chrome and it doesn't work in either of those as well. I also have the problem that when I removed the code the page will now not automatically redirect to the Welcome page when you register. I suspect the problem is not entirely in the Authentication.tpl file. If you have any clues as to where I should look to try to solve this I'd be very grateful.RegardsTony Link to comment Share on other sites More sharing options...
Joël Gaujard Posted September 23, 2010 Share Posted September 23, 2010 Sorry I didn't understand very well english (i'm just a french man) I have now tested it in Firefox and Chrome and it doesn't work in either of those as well. I also have the problem that when I removed the code the page will now not automatically redirect to the Welcome page when you register. I suspect the problem is not entirely in the Authentication.tpl file. If you have any clues as to where I should look to try to solve this I'd be very grateful. I don't believe normally PrestaShop redirect a new subscriber to homepage but to last page visited or customer account page.Do you test this code on default theme ? Link to comment Share on other sites More sharing options...
TonyH Posted September 23, 2010 Share Posted September 23, 2010 Le probleme est que apres enregister, le nouveaux utilisateur reste sur le page d'inscription au lieu d'aller au page 'Welcome to your account'. S'il vous plait, pouvez-vous regarder www.lynseydepaul.com/musicstore de pres, et essayer d'enregistrer pour voir le probleme.(I can't speak French but my daughter is learning it, hope this is ok.)RegardsTony Link to comment Share on other sites More sharing options...
Joël Gaujard Posted September 23, 2010 Share Posted September 23, 2010 I just tried to subscribe on your website and I succeed! And I will be redirect to my customer account. What's the problem ?Also I don't see a "confirmation password" field.(tested on Safari 5.0.2 on MAC OS 10.6.4) Link to comment Share on other sites More sharing options...
TonyH Posted September 23, 2010 Share Posted September 23, 2010 OK, hanks for trying perhaps the redirection isn't a problem.I took the “confirmation password” field off as it wasn't working. I've just put it back, so please try it and see if it works for you.ThanksTony Link to comment Share on other sites More sharing options...
Joël Gaujard Posted September 23, 2010 Share Posted September 23, 2010 I just tried it and it doesn't work Link to comment Share on other sites More sharing options...
rocky Posted September 26, 2010 Share Posted September 26, 2010 I've fixed it. The problem is that the "Bloc My Account" module was installed, so there are two "passwd" fields. Since the one in the "My Account" block is declared first, the code was comparing the password of it to the "Confirm Password" field. I fixed it by changing: if ($('#passwd').attr('value') == $('#passwd_confirm').attr('value')) to: if ($('#center_column #passwd').attr('value') == $('#passwd_confirm').attr('value')) so that the center column passwd is selected instead of the "My Account" block passwd. Link to comment Share on other sites More sharing options...
simpson7647 Posted October 19, 2010 Share Posted October 19, 2010 Hi rocky, so the code you said about earlier in the post on page 1, i have to enter and then the above? Where do i past the above too?thanks Link to comment Share on other sites More sharing options...
rocky Posted October 20, 2010 Share Posted October 20, 2010 You should put the code here after the password field on line [spam-filter]96 of authentication.tpl (in PrestaShop v1.3.2): {l s='Password'} <input type="password" class="text" name="passwd" id="passwd" /> * {l s='(5 characters min.)'} Link to comment Share on other sites More sharing options...
mytheory. Posted October 20, 2010 Share Posted October 20, 2010 Anybody using the One Page Checkout module with this mod??This mod seems like a must have and a very standard one at that...This works for the log in/authetication/sign up page... but the OPC module gives guest accounts/checkouts the option to sign up for a "real" account by checking a box at the end which then displays a (1) password box... I am interested in knowing if this option could be modded to work with the code/script from this thread.Any help is appreciated! Link to comment Share on other sites More sharing options...
simpson7647 Posted October 20, 2010 Share Posted October 20, 2010 You should put the code here after the password field on line [spam-filter]96 of authentication.tpl (in PrestaShop v1.3.2): {l s='Password'} <input type="password" class="text" name="passwd" id="passwd" /> * {l s='(5 characters min.)'} thanks rocky, so i put the code in the little link thing you made saying 'code' but where does the code you pasted below that go?thanks Link to comment Share on other sites More sharing options...
rocky Posted October 20, 2010 Share Posted October 20, 2010 That code should already be in your authentication.tpl. You should put the code from the link below that code. Link to comment Share on other sites More sharing options...
simpson7647 Posted October 20, 2010 Share Posted October 20, 2010 Thankyou rocky.so i just have to add the the piece you've linked saying 'code' Link to comment Share on other sites More sharing options...
rocky Posted October 20, 2010 Share Posted October 20, 2010 Yes, put the "Confirm password" field underneath the existing "Password" field on lines [spam-filter]96. Link to comment Share on other sites More sharing options...
simpson7647 Posted October 20, 2010 Share Posted October 20, 2010 thankyou Rocky, i simply pasted it below that part and it works with google chrome.is it likely to work with all browsers etc now?thanks Link to comment Share on other sites More sharing options...
rocky Posted October 20, 2010 Share Posted October 20, 2010 Yes, it should work in all browsers that have Javascript enabled. Link to comment Share on other sites More sharing options...
simpson7647 Posted October 20, 2010 Share Posted October 20, 2010 thanks a lot rocky Link to comment Share on other sites More sharing options...
Steppo Posted October 21, 2010 Share Posted October 21, 2010 Supergreat!!!I get these funny letters in swedish - only on this script. Why is that? Link to comment Share on other sites More sharing options...
rocky Posted October 22, 2010 Share Posted October 22, 2010 It seems the message box don't support HTML. I guess you will have to use the actual characters instead of HTML codes. Link to comment Share on other sites More sharing options...
Steppo Posted October 22, 2010 Share Posted October 22, 2010 Ill try the opposite then:) The translations in BO is identical to the other swedish words in the /lang/sv file.Thanks for ideas! Great ideas of you guys with the function.//Stefan Link to comment Share on other sites More sharing options...
Yoriel79 Posted April 25, 2011 Share Posted April 25, 2011 Hello.Thanks for the solution, but in Prestashop 1.4 is not possible to solve this problem by the same way. Could any body help me with this problem under Prestashop 1.4, please?Thanks. Link to comment Share on other sites More sharing options...
nasos Posted August 24, 2011 Share Posted August 24, 2011 i'd like that in 1.4 too .. Link to comment Share on other sites More sharing options...
Francisco Carlão Posted September 14, 2011 Share Posted September 14, 2011 for prestashop 1.4.3 ( and above i think): go to themes/yourtheme/authentication.tpl find: <p class="required password"> <label for="passwd">{l s='Password'}</label> <input type="password" name="passwd" id="passwd" /> <sup>*</sup> <span class="form_info">{l s='(5 characters min.)'}</span> </p> right after this insert: <p class="required password"> <label for="passwd_confirm">{l s='Confirm password'}</label> <input type="password" class="text" name="passwd_confirm" id="passwd_confirm" /> <sup>*</sup> </p> 2º go to: /controllers/AuthController.php find this: $_POST['firstname'] = $_POST['customer_firstname'] below insert this: if (Tools::getValue('passwd') != Tools::getValue('passwd_confirm')) $this->errors[] = Tools::displayError('Passwords do not match'); its done , dont forget to backup ypu files before doing this changes 3 Link to comment Share on other sites More sharing options...
ericktoti Posted December 26, 2011 Share Posted December 26, 2011 Thank you friends! thank you rocky. Work fine! Gracias Francisco for prestashop 1.4.3 ( and above i think): go to themes/yourtheme/authentication.tpl find: <p class="required password"> <label for="passwd">{l s='Password'}</label> <input type="password" name="passwd" id="passwd" /> <sup>*</sup> <span class="form_info">{l s='(5 characters min.)'}</span> </p> right after this insert: <p class="required password"> <label for="passwd_confirm">{l s='Confirm password'}</label> <input type="password" class="text" name="passwd_confirm" id="passwd_confirm" /> <sup>*</sup> </p> 2º go to: /controllers/AuthController.php find this: $_POST['firstname'] = $_POST['customer_firstname'] below insert this: if (Tools::getValue('passwd') != Tools::getValue('passwd_confirm')) $this->errors[] = Tools::displayError('Passwords do not match'); its done , dont forget to backup ypu files before doing this changes Link to comment Share on other sites More sharing options...
simpson7647 Posted April 5, 2012 Share Posted April 5, 2012 Does this still work for the latest 1.4.7? thanks, Link to comment Share on other sites More sharing options...
viger Posted October 18, 2012 Share Posted October 18, 2012 (edited) Great thread! Thanks to all, I solved this heavy point. It's quite incredible that by default PS hasn't both email and password confirmation and a URL confirmation by email to validate the email. Anyway, here the mod for PS 1.5.0.17 (and up, I hope), for email and for password confirmation (for email validation I'm still searching for ). In BO will appears fields for translating new fields in the FO auth page. It seems to works very fine for me, but please test it! In /themes/your-theme/authentication.tpl find: <p class="required text"> <label for="email">{l s='E-mail'} <sup>*</sup></label> <input type="text" class="text" id="email" name="email" value="{if isset($smarty.post.email)}{$smarty.post.email}{/if}" /> </p> after insert: <p class="required text"> <label for="email_confirm">{l s='Confirm e-mail'} <sup>*</sup></label> <input type="text" class="text" name="email_confirm" id="email_confirm" /> </p> find: <p class="required password"> <label for="passwd">{l s='Password'} <sup>*</sup></label> <input type="password" class="text" name="passwd" id="passwd" /> <span class="form_info">{l s='(5 characters min.)'}</span> </p> after insert: <p class="required password"> <label for="passwd_confirm">{l s='Confirm password'} <sup>*</sup></label> <input type="password" class="text" name="passwd_confirm" id="passwd_confirm" /> </p> In /controllers/front/AuthController.php find: if (!Tools::getValue('phone') && !Tools::getValue('phone_mobile') && Configuration::get('PS_REGISTRATION_PROCESS_TYPE')) $this->errors[] = Tools::displayError('You must register at least one phone number'); after insert: // Email confirmation if (Tools::getValue('email') != Tools::getValue('email_confirm')) $this->errors[] = Tools::displayError('Both email do not match'); // Password confirmation if (Tools::getValue('passwd') != Tools::getValue('passwd_confirm')) $this->errors[] = Tools::displayError('Both passwords do not match'); That's all, it works fine! Edited October 18, 2012 by viger (see edit history) 1 Link to comment Share on other sites More sharing options...
Eurobean Posted October 28, 2012 Share Posted October 28, 2012 Thank you Viger ! This works perfectly on version 1.4.8.2, tested on explorer, firefox and chrome. I agree, this should be a default feature, or at least an option! I would recommend however, rather than modifying the AddressController.php file directly, that it be copied into the override folder at /override/controllers and then edited. If editing the file from within the override folder, remember to modify line 28 of the file from class AuthControllerCore extends FrontController to class AuthController extends FrontController Thank you again Viger for your solution and to everyone for treating this topic! 1 Link to comment Share on other sites More sharing options...
viger Posted October 28, 2012 Share Posted October 28, 2012 I would recommend however, rather than modifying the AddressController.php file directly, that it be copied into the override folder at /override/controllers and then edited. Yes, you're right, it's better indeed. Thanks to you too! Link to comment Share on other sites More sharing options...
simpson7647 Posted December 7, 2012 Share Posted December 7, 2012 Hi, I can't get this working, The Theme I use is Theme318 and I've posted the code both here : /home/protect1/themes/theme318/authentication.tpl /home/protect1/public_html/themes/theme318/authentication.tpl What am I doing wrong here as It doesn't seem to be working. Thanks, Link to comment Share on other sites More sharing options...
ciepolml Posted January 12, 2013 Share Posted January 12, 2013 Hello Just wanted to thank you for very interesting discussion and examples. It saved my time and works great with PrestaShop 1.4.9.0. If somebody is unsure about 4.9 - password recovery works fine, errors are displayed correctly, user has to confirm password when updating profile too. Very nice solution! Link to comment Share on other sites More sharing options...
cyjambo Posted March 24, 2013 Share Posted March 24, 2013 Great thread! Thanks to all, I solved this heavy point. It's quite incredible that by default PS hasn't both email and password confirmation and a URL confirmation by email to validate the email. Anyway, here the mod for PS 1.5.0.17 (and up, I hope), for email and for password confirmation (for email validation I'm still searching for ). In BO will appears fields for translating new fields in the FO auth page. It seems to works very fine for me, but please test it! In /themes/your-theme/authentication.tpl find: <p class="required text"> <label for="email">{l s='E-mail'} <sup>*</sup></label> <input type="text" class="text" id="email" name="email" value="{if isset($smarty.post.email)}{$smarty.post.email}{/if}" /> </p> after insert: <p class="required text"> <label for="email_confirm">{l s='Confirm e-mail'} <sup>*</sup></label> <input type="text" class="text" name="email_confirm" id="email_confirm" /> </p> find: <p class="required password"> <label for="passwd">{l s='Password'} <sup>*</sup></label> <input type="password" class="text" name="passwd" id="passwd" /> <span class="form_info">{l s='(5 characters min.)'}</span> </p> after insert: <p class="required password"> <label for="passwd_confirm">{l s='Confirm password'} <sup>*</sup></label> <input type="password" class="text" name="passwd_confirm" id="passwd_confirm" /> </p> In /controllers/front/AuthController.php find: if (!Tools::getValue('phone') && !Tools::getValue('phone_mobile') && Configuration::get('PS_REGISTRATION_PROCESS_TYPE')) $this->errors[] = Tools::displayError('You must register at least one phone number'); after insert: // Email confirmation if (Tools::getValue('email') != Tools::getValue('email_confirm')) $this->errors[] = Tools::displayError('Both email do not match'); // Password confirmation if (Tools::getValue('passwd') != Tools::getValue('passwd_confirm')) $this->errors[] = Tools::displayError('Both passwords do not match'); That's all, it works fine! Hi viger, Thanks a lot for the help with this. It works fine with normal checkout when you are logged in, but it doesn't work with guest checkout. It gives the errors Both email do not match Both passwords do not match when pressing save after filling out the delivery address. Of course it is because the guest check-out does not have the password field and only 1 email field. Do you know how to change your code so it does not take into consideration when guest-checkout is used? I am using 1.5.3.1 btw. Thanks a lot! Link to comment Share on other sites More sharing options...
cyjambo Posted March 24, 2013 Share Posted March 24, 2013 Ok, I figured it out. If you want to make this work for guest checkout then you need to add this code: if (Tools::getValue('is_new_customer', 1) && Configuration::get('PS_GUEST_CHECKOUT_ENABLED')) { // Email confirmation if (Tools::getValue('email') != Tools::getValue('email_confirm')) $this->errors[] = Tools::displayError('Both email do not match'); // Password confirmation if (Tools::getValue('passwd') != Tools::getValue('passwd_confirm')) $this->errors[] = Tools::displayError('Both passwords do not match'); } instead of just: // Email confirmation if (Tools::getValue('email') != Tools::getValue('email_confirm')) $this->errors[] = Tools::displayError('Both email do not match'); // Password confirmation if (Tools::getValue('passwd') != Tools::getValue('passwd_confirm')) $this->errors[] = Tools::displayError('Both passwords do not match'); This seem to work fine (not sure if it is the correct way to do it, so please test everything before goin live). I hope this helps someone! Link to comment Share on other sites More sharing options...
viger Posted March 26, 2013 Share Posted March 26, 2013 Hello cyjambo, actually I think you're right, I didn't check the mod with guest checkout because I don't use it. I tried your mod in my local installation and it seems to work fine, many thanks! Link to comment Share on other sites More sharing options...
nakiodev Posted August 2, 2013 Share Posted August 2, 2013 don't work on prestashop 1.5.4 Link to comment Share on other sites More sharing options...
vekia Posted August 2, 2013 Share Posted August 2, 2013 don't work on prestashop 1.5.4 you tried method mentioned by cyjambo above? Link to comment Share on other sites More sharing options...
nakiodev Posted August 2, 2013 Share Posted August 2, 2013 you tried method mentioned by cyjambo above? I tried but it does not work Link to comment Share on other sites More sharing options...
katja lah Posted December 1, 2015 Share Posted December 1, 2015 Hi, Could anyone help me I am sad spent 100 hours to solve confirm password in controller but no result. I use Prestashop 1.6.1.2 I will be very appreciate. Very very Thank you in advance. 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