Home Forums Theme Support Dokan Redirect Sellers to Home after Login

This topic is: resolved

This topic contains 2 replies, has 2 voices, and was last updated by  Mario 4 years, 2 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #38116

    Mario
    Member
    Post count: 11

    Hello!

    How can I redirect sellers to homepage instead of my account upon logging in?

    #38163

    Nayem
    Moderator
    Post count: 6480

    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 ๐Ÿ™‚

    #38216

    Mario
    Member
    Post count: 11

    Thanks that worked!

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Redirect Sellers to Home after Login’ is closed to new replies.