How to Redirect WooCommerce User to Login Page

Via:MyTutorialGuru.com

Recently we have developed a WooCommerce private shop for one of our client. If you have a private shop and want only registered user have access to the shop then you might want to keep the shop page private and force user to login. If you are looking for the solution then you have came to right place. Lets see the code snippet.


add_theme_support( 'woocommerce' );
function wpse_131562_redirect()
add_action('template_redirect', 'wpse_131562_redirect');

Add the above code to tour themes functions.php file and you are done.

Advertisements

Posted on April 26, 2015, in Uncategorized. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: