• Hi there!

    I’m currently trying to add a notice after a redirection function.

    My register page is separate from my account page. After registration, the user is disconnected and redirected to my account page to login.

    What I want to do is to add a notice to my account page after this registration redirection.

    My current code is :

    /* Redirect after registration */
    function wc_registration_redirect( $redirect_to ) {
            wp_logout();
            wp_redirect( wc_get_page_permalink( 'myaccount' ) );
            wc_add_notice( __( pll__('Thank you for your registration! Please check your email to get your password.'), 'inkfool' ) );
            exit;
    }
    add_filter('woocommerce_registration_redirect', 'wc_registration_redirect');

    The redirection works well, but no notice appear.

    I’m probably doing it wrong but I’ve no idea how to figure out of this.

    If you guys have suggestion it would be very welcome 🙂

    Cheers!

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘wc_add_notice after a registration redirection’ is closed to new replies.