• Resolved medbens

    (@medbens)


    I want the vendor to only access the dashboard and not the woocommerce account, and is that possible?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello @medbens ,

    Do you want to disable access to WooCommerce’s my-account page for vendors?

    You can use the template_reirect action of WordPress to do that. For example –

    function custom_redirects() {
     
        $user = wp_get_current_user();
    
        if ( is_account_page() && (in_array( 'seller', (array) $user->roles )) ) {
            wp_redirect( home_url( '/dashboard/' ) ); //change dashboard to your dashboard slug
            die;
        }
     
    }
    add_action( 'template_redirect', 'custom_redirects' );

    Try this code in your functions.php file. It will redirect the vendors to the dashboard if they try to visit the my-account page.

    You can also use any permission-related plugin for WordPress to achieve the result.

    Thank you 🙂

    Thread Starter medbens

    (@medbens)

    I will try this and thanks for your quick reply

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

The topic ‘access vendor dashboard’ is closed to new replies.