Home Forums Theme Support Dokan Redirect Sellers to Dashboard when logging in

This topic is: resolved

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

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #42917

    Paul
    Member
    Post count: 24

    At present when a new seller signs up or logs in they are redirected to the My Account page.

    Would it not be more logical to redirect them to the Seller Dashboard? – I think the settings tab would be best place to send them.

    Can this be done?

    Thanks

    #42920

    Nayem
    Moderator
    Post count: 6480

    Hello Paul,

    If you want to redirect seller to his dashboard after login then use this code in your child theme function.php file-

    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 dokan_get_navigation_url(‘dashboard’);   
        }
    
    return $redirect_url;
    }

    Thanks.

    #42945

    Paul
    Member
    Post count: 24

    Thanks

    That worked perfectly.

    #42972

    Nayem
    Moderator
    Post count: 6480
    This reply has been marked as private.
Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Redirect Sellers to Dashboard when logging in’ is closed to new replies.