Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello, you conseguio solve your problem? Because I need the same help.

    Hi there!! im looking for the same here!

    I was faced with this problem today.

    Here was my solution:

    <?php
    //Add this to the top of your header.php file (in your theme). By: Bradford Nelson
    //Check if user is not logged in
    if ( !is_user_logged_in() ) {
    	$url_uri = $_SERVER['REQUEST_URI'];
    	//redirect shop page.
    	if ( $url_uri == '/shop/' ) {
    		wp_redirect( home_url( '/restricted' ) );
    	}
    }
    ?>

    Note* you can change the ‘/restricted’ to any page slug you want, or just use home_url() to redirect to the home page.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Restrict woocommerce shop page’ is closed to new replies.