oarecare Posted July 23, 2011 Share Posted July 23, 2011 I'm trying to add some advanced validation fields in registration form, but apparently they are checked after the user has been entered to the database Can anyone paste a snippet of hookCreateAccount that will return the errors and not add the user to the db? TIA Link to comment Share on other sites More sharing options...
oarecare Posted July 25, 2011 Author Share Posted July 25, 2011 No news? All i want is a module-based server-side validatable field in the registration form, which, if not valid, doesn't allow the the user to be added to the db Link to comment Share on other sites More sharing options...
Richard S Posted July 25, 2011 Share Posted July 25, 2011 hi, I do not think that there are people who will write all solution to you But you might try to use this kind of error handling: $this->errors[] = Tools::displayError('Invalid e-mail address'); I am not sure if it works right especially with $this, but it's worth trying. And the hook is executed in AuthController.php line 187. EDIT: in addition, the values of form fields are checked before adding to the databse in createAccount hook, so there might be errors in your code. Link to comment Share on other sites More sharing options...
oarecare Posted July 25, 2011 Author Share Posted July 25, 2011 I tried. Apparently, according to nethercott, the hook is "Used to run code after a new customer account has been created." I'll need to either: - create another hook in the validation, prior to the 'createAccount' hook (which i don't think can be done from a module) - add some fancy ajax to stop the form from being submitted, thus interfering with the look and feel of presta Link to comment Share on other sites More sharing options...
bellini13 Posted July 25, 2011 Share Posted July 25, 2011 i concur that you will need to do some customization. you could override the controller and just add the new the new hook in the correct place. Then create the module that does what you require when the hook is triggered. 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