Redirecting vendors to dashboard

Home Forums WC Vendors Free Support Redirecting vendors to dashboard

NOTICE: We've Moved to a Ticket System for Support

As of August 31, 2017 (12am EST) our support forums will be retired (read-only), and we will be moving to a support ticket system.  This will allow us to better organize and answer support requests, and provide a more personalized experience as we assist our customers.

For the time being, we will leave our forums open for reading and learning while we work on creating a more robust Knowledge Base for everyone to use.

If you are a WC Vendors Pro customer please open a support ticket here. 

If you are a WC Vendors user please open a support ticket on the Wordpress.org forums.

The information on this forum is outdated and in most instances no longer relevant. Please be sure to check our documentation for the most up to date information.

https://docs.wcvendors.com/

Thank you to all of our customers!

 

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #514
    dymockpoet
    Participant

    Hi Ben,

    I can’t get your knowledgebase article on redirecting vendors to the seller dashboard to work: https://www.wcvendors.com/knowledgebase/redirecting-vendors-seller-dashboard-login/

    I’ve pasted the code into functions.php, but when I login as a seller, I am not re-directed anyway. I just go to the seller’s setting page.

    I think one of the commenters may be on to something when she says the code is wrong.

    [php]
    /* Redirect Sellers to Seller Dashboard on Login */
    add_filter(‘woocommerce_login_redirect’, ‘login_redirect’, 10, 2);
    function login_redirect( $redirect_to, $user ) {
    if ( PV_Vendors::is_vendor( $user->id ) ) {
    $pv_settings = get_option(‘wc_prd_vendor_options’);
    $shop_settings_page = $pv_settings[‘shop_settings_page’];
    $redirect_to = get_permalink($shop_settings_page);
    return $redirect_to;
    } else {
    $redirect_to = ‘my-account’;
    return $redirect_to;
    }
    }
    [/php]

    The line I’ve highlighted, shouldn’t that redirect to the vendor dashboard page?

    #517
    ben
    Keymaster

    Page formatting was off. Check it again and copy & paste that code, should do the trick!

    #518
    dymockpoet
    Participant

    Now I’m getting this error:

    Parse error: syntax error, unexpected ‘&’ in /home/madbiddi/public_html/thebookcoverdesigner.com/wp-content/themes/thebookcoverdesigner/functions.php on line 135

    Line 135 is this one: if ( PV_Vendors::is_vendor( $user->id ) ) {

    #519
    ben
    Keymaster

    Fixed on KnowledgeBase Article.

    change /seller_dashboard to the URI of the page you want sellers to be redirected to.

    • This reply was modified 6 years, 3 months ago by ben.
    #522
    dymockpoet
    Participant

    That works perfectly, thanks!

    #523
    ben
    Keymaster

    You are very welcome. 🙂

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘WC Vendors Free Support’ is closed to new topics and replies.

Pro Bundle Special Offer 35% OFF

Get all the plugins essential for your marketplace website in one place and save. Over $600 value for just $397!

This website uses cookies to ensure you get the best experience on our website.