• Resolved mihaiiceyro

    (@mihaiiceyro)


    I’m trying to redirect all users that log in into the page but it still redirects me to “my-account” and I don’t want that.
    Here is the code:

    add_filter( 'woocommerce_login_redirect', 'icey_coop_redirect_customer', 9999, 2 );
    function icey_coop_redirect_customer( $redirect, $user ) {
         
        if ( wc_user_has_role( $user, 'customer' ) ) {
            $redirect_to = get_permalink(733);
        }
      
        return $redirect;
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support RK a11n

    (@riaanknoetze)

    Hi there,

    This is a fairly complex development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    I can also recommend the WooCommerce Developer Resources Portal for resources on developing for WooCommerce.

    You can also visit the WooCommerce Facebook group or the #developers channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    Plugin Support mouli a11n

    (@mouli)

    It’s been a while since we heard from you, so I’m marking this thread resolved. Hopefully, you’ve been able to resolve this, but if you haven’t, please open up a new topic and we’ll be happy to help out.

    The value of $redirect in your code is not changed… try the below

    
            $redirect = get_permalink(733);
        
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘can’t redirect user “customer” after login’ is closed to new replies.