nakiodev 2 Posted August 2, 2013 Posted August 2, 2013 Hi!, I'm trying to insert the field "confirm password" to the customer record. I found some solutions on this forum, but have not worked. Do you have any suggestions? Using Prestashop 1.5.4, as always sorry for my English. thanks Share this post Link to post Share on other sites
vekia 8,961 Posted August 2, 2013 Posted August 2, 2013 sorry can you clarify whay you exactly expect? you're trying to create some feature to verify customer account, or what? Share this post Link to post Share on other sites
nakiodev 2 Posted August 2, 2013 Posted August 2, 2013 (edited) No just want to do what you see in the picture: Edited August 2, 2013 by nakiodev (see edit history) Share this post Link to post Share on other sites
nakiodev 2 Posted August 4, 2013 Posted August 4, 2013 up Share this post Link to post Share on other sites
Mellow 112 Posted August 8, 2013 Posted August 8, 2013 Try this : In authentication.tpl after <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='(Five characters minimum)'}</span> </p> add <p class="required password"> <label for="confirm_passwd">{l s='Confirm password'} <sup>*</sup></label> <input type="password" class="text" name="confirm_passwd" id="confirm_passwd" /> </p> Do the same in order-opc-new-account.tpl (for "One page checkout" mode) In AuthController.php after // Checked the user address in case he changed his email address if (Validate::isEmail($email = Tools::getValue('email')) && !empty($email)) if (Customer::customerExists($email)) $this->errors[] = Tools::displayError('An account using this email address has already been registered.', false); add // Check if password matches confirmation if (Tools::getValue('passwd') != Tools::getValue('confirm_passwd')) $this->errors[] = Tools::displayError('Password confirmation does not match password !', false); This should work ! But best practice would be to create an override of AuthController instead of modifying the core file... 3 Share this post Link to post Share on other sites
vekia 8,961 Posted August 8, 2013 Posted August 8, 2013 woohoo, very nice solution thanks for that! Share this post Link to post Share on other sites
Mellow 112 Posted August 8, 2013 Posted August 8, 2013 You're welcome Notice that the same model could be used for email, and also we could add this on the new input field to avoid copy/paste autocomplete="off" onpaste="return false;" oncopy="return false;" oncontextmenu="return false;" 1 Share this post Link to post Share on other sites
nakiodev 2 Posted August 8, 2013 Posted August 8, 2013 Try this : In authentication.tpl after <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='(Five characters minimum)'}</span> </p> add <p class="required password"> <label for="confirm_passwd">{l s='Confirm password'} <sup>*</sup></label> <input type="password" class="text" name="confirm_passwd" id="confirm_passwd" /> </p> Do the same in order-opc-new-account.tpl (for "One page checkout" mode) In AuthController.php after // Checked the user address in case he changed his email address if (Validate::isEmail($email = Tools::getValue('email')) && !empty($email)) if (Customer::customerExists($email)) $this->errors[] = Tools::displayError('An account using this email address has already been registered.', false); add // Check if password matches confirmation if (Tools::getValue('passwd') != Tools::getValue('confirm_passwd')) $this->errors[] = Tools::displayError('Password confirmation does not match password !', false); This should work ! But best practice would be to create an override of AuthController instead of modifying the core file... It works! You're the best! Thank you! p.s. i've created authcontroller.php in ovverride/front/ 1 Share this post Link to post Share on other sites
vekia 8,961 Posted August 8, 2013 Posted August 8, 2013 thanks for information that it works for you im going to mark this topic as [solved] thanks again for fantastic solution Share this post Link to post Share on other sites
dfml 0 Posted July 16, 2014 Posted July 16, 2014 (edited) Thanks for this information. Can you tell me what should i do for the phrase "'Password confirmation does not match password " appears in the translation backoffice options? (sorry for my english) cumps [solve] Edited July 21, 2014 by dfml (see edit history) Share this post Link to post Share on other sites
RaúlS 0 Posted December 11, 2014 Posted December 11, 2014 Perfect!!!! It works 100%!! Thank you very much! Share this post Link to post Share on other sites
remoteONE 3 Posted September 10, 2015 Posted September 10, 2015 Need this also. I don't want future updats to over-write the changes. So the mod'd AuthController.php file will go in /override/controllers/front/AuthController.php But where should the mod'd authentication.tpl file be placed? Share this post Link to post Share on other sites
ukbaz 36 Posted January 14, 2016 Posted January 14, 2016 This does not appear to work in latest version 1.6.1.4 Tried it (modified) for registration email and is allowing registration with different emails in fields. Has anyone got code that works in 1.6.1 and later? Thanks Baz Share this post Link to post Share on other sites
NaveenYadav 1 Posted February 23, 2016 Posted February 23, 2016 Hello, This validation will work on form submit. What I need to do if I want js validation as set for other fields? Share this post Link to post Share on other sites
Recommended Posts