• Resolved poetrybattles

    (@poetrybattles)


    Im using the free WC Vendor plugin. I added the code below to my functions.php but the login still wont redirect to the vendors dashboard when vendors login. Please help..

    Is there a certain spot the code should go? I tried at the top bottom and middle.. Thanks you very much.

    /* Redirect Vendors to Vendor Dashboard on Login */
    add_filter(‘woocommerce_login_redirect’, ‘login_redirect’, 10, 2);
    function login_redirect( $redirect_to, $user ) {

    // WCV dashboard — Uncomment the 3 lines below if using WC Vendors Free instead of WC Vendors Pro
    if (class_exists(‘WCV_Vendors’) && WCV_Vendors::is_vendor( $user->id ) ) {
    $redirect_to = get_permalink(WC_Vendors::$pv_options->get_option( ‘vendor_dashboard_page’ ));
    }

    // WCV Pro Dashboard
    if (class_exists(‘WCV_Vendors’) && class_exists(‘WCVendors_Pro’) && WCV_Vendors::is_vendor( $user->id ) ) {
    $redirect_to = get_permalink(WCVendors_Pro::get_option( ‘dashboard_page_id’ ));
    }
    return $redirect_to;
    }

    The page I need help with: [log in to see the link]

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

    (@digitalchild)

    Hello,

    This is the old way to do it as the

    WCVendors_Pro::get_option( ‘dashboard_page_id’ ))

    To this

    get_permalink( get_option( 'wcvendors_vendor_dashboard_page_id' ) );

    As a side note, this is a simple settings option in wc vendors pro along with a fully functioning front end for your developers.

    cheers,

    Jamie.

    Thread Starter poetrybattles

    (@poetrybattles)

    I’m sorry for the late response Jamie i was feeling a little sick..

    Im not sure where you want me to place the code you gave me. Could you be a dear and just copy and paste the entire code i need to put in the functions.php im still a nob. lol

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WC Vendor’ is closed to new replies.