Home Forums WoodMart support forum redirect user login

redirect user login

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #312721

    high5
    Participant

    Hello, 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.

    #312777

    Artem Temos
    Keymaster

    Hello,

    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

    #312800

    high5
    Participant

    Hi,
    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.

    #312848

    Artem Temos
    Keymaster

    Hello,

    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

    #312881

    high5
    Participant

    If 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.

    #312883

    Artem Temos
    Keymaster

    Our 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.

Viewing 6 posts - 1 through 6 (of 6 total)