Redirect to checkout afte Sign in / Sign up
-
Hello,
I hope you’re doing well.
I recently added a plugin that forces user to login before checkout.
I am using Ultimate Member plugin.
I also added this code, that makes them go to checkout after signing in / up, But is doesn’t work if they sign in/up using google or facebook, ie through the Super Socializer plugin.add_action('template_redirect','um_122021_check_if_logged_in'); function um_122021_check_if_logged_in() { $pageid = get_option( 'woocommerce_checkout_page_id' );// your checkout page id if( ! is_user_logged_in() && is_page( $pageid ) && function_exists('um_get_core_page') ) { $url = add_query_arg( 'redirect_to', get_permalink($pageid), um_get_core_page("register") ); wp_redirect( $url ); exit; } }
Can you please help me fix it ? I want to redirect them to checkout if they are redirected to login after trying to go to checkout. But I don’t want to redirect them if they are loggin in normally.
Best regards,
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Redirect to checkout afte Sign in / Sign up’ is closed to new replies.