I’m setting up a WooCommerce shop for a client and he has requested that the user be redirected back to the login form after the reset password form has been submitted.
Is this possible? Which function controls this?
Thanks in advance.
I’m setting up a WooCommerce shop for a client and he has requested that the user be redirected back to the login form after the reset password form has been submitted.
Is this possible? Which function controls this?
Thanks in advance.
You must be logged in to post a comment.
A much cleaner solution is to redirect using the
woocommerce_customer_reset_password
action:This code can be placed in
functions.php
.Someone asked me about doing this and I think I’m going to talk them out of it, but here’s what I came up with so that you could see the message and then be redirected in 5 seconds. Add a message/link to let them know you’ll be redirecting. Plus, this will last through a WooCommerce upgrade if you add the template file to your theme
Add the form-lost-password.php template file to your theme and add the following code:
If you dont want the time delay get rid of the window.setTimeout() and just use window.location.replace(‘$my_account_url’).
I’m just facing the same question. I think the function that controls this is in the file
woocommerce/includes/class-wc-form-handler.php
. I changed the following line:with
With that change, you get redirected to the my-account page, where the customer can log in, but of course there are two problems doing that:
Would be great, if someone could come up with a “update-secure” solution.
Best regards
Christoph