Redirect Sellers to Home after Login

This topic contains 2 reply and 2 voices, and was last updated by Mario 9 years, 8 months ago
Viewing 2 Posts - 1 through 2 (of 2 total)
Author Posts
March 4, 2015 at 12:10 am 38116
Mario Hello! How can I redirect sellers to homepage instead of my account upon logging in?
March 4, 2015 at 1:12 pm 38163
Nayem Nayem

Hello Mario,

You need to add some code to redirect seller to Homepage. Here is those code-

add_filter( 'woocommerce_login_redirect', 'ckc_login_redirect', 10, 2 );

function ckc_login_redirect( $redirect_url, $user ) {
    // Change this to the url to Updates page

    if( $user->roles[0] == 'seller' ) {
        return home_url('/');    
    }

    return $redirect_url;
}

Please insert those code your theme function.php file.

Thank you 🙂

March 4, 2015 at 9:18 pm 38216
Mario Mario

Thanks that worked!

Viewing 2 Posts - 1 through 2 (of 2 total)