When customer submit his email in Forgot Password page he is redirected to the Login or Create an Account page. How could I redirect users to the Homepage or to the Onepage Checkout page?
Magento – Redirect to homepage after submitting e-mail in Forgot password page
loginmagento-1.7redirecturlurl-rewrite
Best Answer
This one is a bit tricky without rewriting the controller action but this should work. I called my example extension
Emzee_ForgotPasswordRedirect
.What it does: after the normal action for creating the forgott password email and redirect instruction has happened, an observer hooks into the postdispatch event of the action, checks if an success action (and no error message) is saved in the customer session and overwrites the redirect to redirect to the homepage.
Caveat: checking for the session messages is a bit hacky but there is no other way to tell whether the forgot password action was successful or not.
XML extension activation file
app/etc/modules/Emzee_ForgotPasswordRedirect.xml
:XML extension configuration file
app/code/community/Emzee/ForgotPasswordRedirect/etc/config.xml
:Observer
app/code/community/Emzee/ForgotPasswordRedirect/Model/Observer.php
:If you want to redirect to the checkout instead to the homepage, replace
with