• panda

    (@alejorostata)


    The form of reset password via email will redirect to lost-password/?reset-link-sent=true after submission with a message of;

    Password reset email has been sent.
    
    A password reset email has been sent to the email address on file for your account, but may take several minutes to show up in your inbox. Please wait at least 10 minutes before attempting another reset. 

    Instead of that, I would like to redirect into the specific page I created. How can I do that?

    I tried the following but it doesn’t work.

    
    function woocommerce_new_pass_redirect($user) {
       wp_redirect(home_url().'/password-recovery-confirmation');
       exit;
    }
    add_action( 'woocommerce_customer_reset_password', 'woocommerce_new_pass_redirect' );
Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter panda

    (@alejorostata)

    This is what I’ve done so far.

    
    function myi_redirections() {
    
    		if(isset($_GET['reset-link-sent']) && $_GET['reset-link-sent'] === 'true') {
    			wc_add_notice( __( "Instructions sent to email", 'gateway' ), 'success' );
    			wp_redirect(home_url().'/password-recovery-confirmation');
    			exit;
    		}
    }
    add_action( 'template_redirect', 'myi_redirections' );

    But for some reason, the notice is not working or not showing up on Microsoft Edge Browser except on Firefox and Google Chrome.

    Hi @alejorostata – I’ve tested this on my local site and do see that this works in Firefox, although I also see that it works in Edge: https://d.pr/i/CJ8Pjv

    What version of Edge are you using to test this? (I used the most recent version)

    Thanks!
    – Joey

    Thread Starter panda

    (@alejorostata)

    I’ve checked the version of Edge;

    Microsoft Edge 44.19041.1.0
    Microsoft EdgeHTML 18.19041

    Anyway, regarding my query about redirecting after submission of the form on lost password, is my approach enough? or is there a hook to simply set the URL?

    Thread Starter panda

    (@alejorostata)

    any update?

    Thread Starter panda

    (@alejorostata)

    I just updated my Firefox into 78.0.2, and now the notice message is no longer works.

    function woocommerce_new_pass_redirect( $user ) {
       wc_add_notice( __( 'Your password has been changed successfully! Please login to continue.', 'woocommerce' ), 'success' );
       wp_redirect( home_url() . "/sign-in/?new-password-created=true" );
       exit;
    }
    add_action( 'woocommerce_customer_reset_password', 'woocommerce_new_pass_redirect' );
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Redirect after submission of form on lost password’ is closed to new replies.