• Resolved leavai

    (@lparga)


    Hi! I have a trouble with RestroPress. When a customer try to login in https://mysite.com/wp-login, after a successful login a blank screen displays. In my console I only view a 500 error. What could I prove to resolve this? If I login with and admin user, login works fine.

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter leavai

    (@lparga)

    I resolved it applying this code in functions.php to redirect users to “orders” page after a successful login.

    //Redirect after login
    
    function my_login_redirect( $url, $request, $user ){
    if( $user && is_object( $user ) && is_a( $user, 'WP_User' ) ) {
    if( $user->has_cap( 'administrator')) {
    $url = admin_url();
    } else {
    $url = home_url('/orders /');
    }
    }
    return $url;
    }
    add_filter('login_redirect', 'my_login_redirect', 10, 3 );
    
    //End Function Redirect after login
    Plugin Contributor Kshirod Patel

    (@kshirod-patel)

    Hello @lparga ,

    Glad to know that you have figured out the issue. Please give us a review if you really liked plugin so far.

    @kshirod-patel how can we create an account to user that goes to checkout page? I want to save the shipping address and chose this on checkout.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Customer Login Error 500’ is closed to new replies.