nakiodev Posted August 2, 2013 Share 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 Link to comment Share on other sites More sharing options...
vekia Posted August 2, 2013 Share 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? Link to comment Share on other sites More sharing options...
nakiodev Posted August 2, 2013 Author Share 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) Link to comment Share on other sites More sharing options...
nakiodev Posted August 4, 2013 Author Share Posted August 4, 2013 up Link to comment Share on other sites More sharing options...
Mellow Posted August 8, 2013 Share 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 Link to comment Share on other sites More sharing options...
vekia Posted August 8, 2013 Share Posted August 8, 2013 woohoo, very nice solution thanks for that! Link to comment Share on other sites More sharing options...
Mellow Posted August 8, 2013 Share 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 Link to comment Share on other sites More sharing options...
nakiodev Posted August 8, 2013 Author Share 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 Link to comment Share on other sites More sharing options...
vekia Posted August 8, 2013 Share 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 Link to comment Share on other sites More sharing options...
dfml Posted July 16, 2014 Share 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) Link to comment Share on other sites More sharing options...
RaúlS Posted December 11, 2014 Share Posted December 11, 2014 Perfect!!!! It works 100%!! Thank you very much! Link to comment Share on other sites More sharing options...
remoteONE Posted September 10, 2015 Share 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? Link to comment Share on other sites More sharing options...
ukbaz Posted January 14, 2016 Share 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 Link to comment Share on other sites More sharing options...
NaveenYadav Posted February 23, 2016 Share 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? Link to comment Share on other sites More sharing options...
Recommended Posts