Home › Forums › WoodMart support forum › redirect user login
redirect user login
- This topic has 5 replies, 2 voices, and was last updated 3 years, 4 months ago by Artem Temos.
-
AuthorPosts
-
August 16, 2021 at 8:26 am #312721
high5ParticipantHello, we use this plugin https://wordpress.org/plugins/role-based-redirect/ because we need to redirect role of user after login to custom page but none of plugin doesn´t work. Is there something in theme what we need to change for correct operation?
Thank you for your advice.
August 16, 2021 at 1:27 pm #312777
Artem TemosKeymasterHello,
Thank you so much for purchasing our theme and contacting our support center.
Could you please check how it works with some default WordPress themes like TwentyTwenty or WooCommerce Storefront to understand is it our theme issue or not?
Regards
August 16, 2021 at 5:21 pm #312800
high5ParticipantHi,
we changed the theme as you navigated us but the problem still continue. We also tryed replace plugin for custom code as you can see down below. Login via wp-admin redirect is working, but via theme button login/register is not.add_filter( ‘woocommerce_login_redirect’, ‘bbloomer_customer_login_redirect’, 9999, 2 );
function bbloomer_customer_login_redirect( $redirect, $user ) {
if ( wc_user_has_role( $user, ‘velkoobchod’ ) ) {
$redirect = get_home_url(); // homepage
//$redirect = wc_get_page_permalink( ‘shop’ ); // shop page
$redirect = ‘/velkoobchodsk’; // custom URL same site
//$redirect = ‘https://custom.url’; // custom URL other site
//$redirect = add_query_arg( ‘password-reset’, ‘true’, wc_get_page_permalink( ‘myaccount’ ) ); // custom My Account tab
}return $redirect;
}Thank you for your advice.
August 17, 2021 at 6:06 am #312848
Artem TemosKeymasterHello,
If it doesn’t work with other themes as well then there is a problem with the plugin itself. In this case, you need to contact plugin developers since it is out of our theme support scope.
Kind Regards
August 17, 2021 at 7:31 am #312881
high5ParticipantIf we use other theme as you recommended it works correctly, but there is not custom login as in woodmart theme. Thats how we found out that it is redirected correctly only if we login directly via xxx.sk/wp-admin.
So we dont use plugin yet but the code from above.
Could you give us advice how we will reach redirecting using your theme?
Thank you in advice.August 17, 2021 at 7:34 am #312883
Artem TemosKeymasterOur theme doesn’t have a custom login. This functionality comes with the WooCommerce plugin. That is why you can test it on the same page with the default theme and not via
wp-admin
only. -
AuthorPosts
- You must be logged in to create new topics. Login / Register