Saturday, April 25, 2015

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.

No comments:

Post a Comment