• Resolved delaitec

    (@delaitec)


    Hello. how are you?
    sorry to take your time again.

    I would like that when registering and when trying to log in (without being approved) the user is redirected to a page of instructions.

    I tried using the code you suggested in this post to redirect after registration, and the redirects works

    add_action( 'user_register', 'myplugin_registration_save', 10, 1 );
    function myplugin_registration_save( $user_id ) {
    wp_redirect( home_url('/profesional/'));
    exit;
    }

    however it generates another problem, woocommerce stops sending the default welcome email to the user.

    From what I’ve researched, it may be because of using “exit” and “die” in the function.

    Heateor Social Login, provided me a code that works correctly with login social only, (after register ou when log in without being approved it redirects to the instructions page), without affecting the sending of emails from woocommerce:

    function heateor_sl_login_page_redirect() {
    if ( isset( $_GET['heateor_ua'] ) ) {
    wp_redirect( '/cadastro-em-analise/' );
    die;
    }
    }
    add_action( 'init', 'heateor_sl_login_page_redirect' );

    How can I do this with the default woocommerce register/login, without affecting the sending of the user’s welcome email?

    I try this code bellow, but doesn’t redirect when NUA is active.

    add_filter( 'woocommerce_registration_redirect', function() {
    return home_url('/politica-de-cookies/');
    } );

    I think doing a pending or denied status check works, but I can’t make any progress on it.

    Can you help-me?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter delaitec

    (@delaitec)

    I try this action new_user_approve_after_registration too, but doesn’t work

    function nua_redirect_after_registration_f( $user_id ) {
    wp_redirect( home_url('/test123/'));
    exit;
    }
    add_action( 'new_user_approve_after_registration', 'nua_redirect_after_registration_f', 10, 1 );

    Maybe i using this in wrong way

    Plugin Support Mirza Hamza

    (@hamza1010)

    Hi @delaitec,

    I hope you are doing well, we have forwarded this to our technical team and we will get back to you.

    Thank you

    Plugin Support Mirza Hamza

    (@hamza1010)

    Hi @delaitec,

    Please add this code in the functions.php file, Replace the URL which you want to redirect.

    Here is the code:

    function redirect_after_registration($user_id) {
        $redirect_url = 'https://google.com'; // Replace with the URL where you want to redirect users
        wp_redirect($redirect_url);
        exit;
    }
    add_action('woocommerce_created_customer', 'redirect_after_registration', 99, 1); 
    
    

    Let us know if you have still have any issues.

    Thank you

    Thread Starter delaitec

    (@delaitec)

    Thankyou, Work perfectly.

    Have a Good Day.

    Plugin Support Mirza Hamza

    (@hamza1010)

    Hi @delaitec,

    We would appreciate a kind and honest review.

    Thank you

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Redirect unapproved user’ is closed to new replies.