-
Author
-
June 19, 2017 at 19:51 #164657Conscious CraftiesParticipant
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
June 20, 2017 at 23:18 #164790LauraModeratorHello, 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 solutionLaura 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 🙂
June 22, 2017 at 19:36 #164938RaduModeratorHi,
In the first instance try to increase the filter priority and check again.
from
COPY CODEadd_filter('woocommerce_login_redirect', 'login_redirect', 10, 2);
to
COPY CODEadd_filter('woocommerce_login_redirect', 'login_redirect', 99, 2);
Let me know
Cheers
RHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionJune 23, 2017 at 02:18 #164993Conscious CraftiesParticipantHi Radu,
It didn’t fix the issue sorry…
Do you have any other suggestions?
June 23, 2017 at 19:01 #165027Conscious CraftiesParticipantHello,
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
June 26, 2017 at 23:45 #165307RaduModeratorHi,
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 solutionJune 27, 2017 at 21:11 #165446Conscious CraftiesParticipantHi Radu,
Sadly it didn’t redirect vendors 🙁
Any other ideas?Many thanks,
Karen
June 29, 2017 at 19:15 #165699RaduModeratorHi,
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 -
AuthorPosts
The forum ‘Bugs & Issues’ is closed to new topics and replies.