Customer's account

  • Resolved
    Posted in: Highend WP Theme  
  • Customer
    kadulja
    March 4, 2015 at 1:01 am #30572

    Hello,

    I have few questions about customers profile.

    1. When customer registers, he gets link for login. After successful log in, he is redirected to wp-admin page which is totally different than front end.

    I have added code to functions.php to overwrite this:

    function my_login_redirect( $redirect_to, $request, $user ) {
    	//is there a user to check?
    	global $user;
    	if ( isset( $user->roles ) && is_array( $user->roles ) ) {
    		//check for admins
    		if ( in_array( 'administrator', $user->roles ) ) {
    			// redirect them to the default place
    			return $redirect_to;
    		} else {
    			return get_the_ID(8);
    		}
    	} else {
    		return get_the_ID(8);
    	}
    }
    add_filter( 'login_redirect', 'my_login_redirect', 10, 3 );

    Now, this works great on /my-account page, which I believe is page-login.php.
    That does not work on top header quick login drop down menu (that would be includes\login-form.php).

    Maybe there is workaround for this? The best would be to include this as fix in next theme update. Customer doesn’t have to login at wp-admin area, everything should be in fronend, if you agree for this specific shopping behaviour which needs to have some kind of flow that is logical and intuitive.

    2. Is there a “child-theme, wpml ready” solution for editing header drop down menu for account information to add some other links for logged in user, like
    – edit billing information
    – edit account
    – edit profile on frontend
    etc.

    Thanks.

    Sorry, this forum is for verified users only. Please Login or Register to continue

Comments are closed.