This topic has 7 replies, 3 voices, and was last updated 7 years by Radu.

  • Author
  • #164657

    Hi there,

    I’ve recently moved to your theme and love it 🙂

    However I have this code to redirect the role “vendor” to their dashboard page when they logged in:

    /* WC Vendors – Redirect Vendors to Vendor Dashboard on Login – not working */

    add_filter(‘woocommerce_login_redirect’, ‘login_redirect’, 10, 2);

    function login_redirect( $redirect_to, $user ) {

    // 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;

    }

     

    It’s no longer redirecting them to this page https://www.consciouscrafties.com/dashboard/

    Could you help?

    Many thanks,

    Karen

    #164790
     Laura
    Moderator

    Hello, will assign the ticket to a higher support level who can help and advise you in your query.
    Thanks! ?

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #164938
     Radu
    Moderator

    Hi,

    In the first instance try to increase the filter priority and check again.

    from

    COPY CODE
    
    add_filter('woocommerce_login_redirect', 'login_redirect', 10, 2);
    

    to

    COPY CODE
    
    add_filter('woocommerce_login_redirect', 'login_redirect', 99, 2);
    

    Let me know

    Cheers
    R

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #164993

    Hi Radu,

    It didn’t fix the issue sorry…

    Do you have any other suggestions?

    #165027

    Hello,

    I’ve noticed that if Vendor role logs in via MyAcccount page they ARE redirected, but not if they log in via the Kleo log in.

    How do i redirect Vendor users to this page if logging in via the Kleo log in?
    https://www.consciouscrafties.com/dashboard/

    Many thanks,

    Karen

    #165307
     Radu
    Moderator

    Hi,

    Try to use this function instead of that one, now it’s used the kleo_modal_login_redirect filter it should redirect in this way.

    https://pastebin.com/raw/i9hvNDDw

    Let me know

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #165446

    Hi Radu,

    Sadly it didn’t redirect vendors 🙁
    Any other ideas?

    Many thanks,

    Karen

    #165699
     Radu
    Moderator

    Hi,

    In this case it means that the conditional logic for detecting if a user it’s a vendor isn’t work as it should, you can ask the WC Vendors team if exist a specific conditional function that cheks if logged in user it’s wc wendor.

    Let me know

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 8 posts - 1 through 8 (of 8 total)

The forum ‘Bugs & Issues’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?