WordPress.org

Ready to get started?Download WordPress

Forums

Page Restrict
Restrict woocommerce shop page (4 posts)

  1. LV2013
    Member
    Posted 9 months ago #

    Can I restrict acces to my woocommerce shop for non registered users? I have a slideshow on my homepage were visitors can see some products and when they klick on the webshop button in my menu I would like them to register first. Is this possible with this plugin?

    http://wordpress.org/plugins/pagerestrict/

  2. marciovecchi
    Member
    Posted 3 months ago #

    Hello, you conseguio solve your problem? Because I need the same help.

  3. assilem1986
    Member
    Posted 1 month ago #

    Hi there!! im looking for the same here!

  4. Bradford Nelson
    Member
    Posted 3 weeks ago #

    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.

Reply

You must log in to post.

About this Plugin

About this Topic