WordPress.org

Forums

Page Restrict
Restrict woocommerce shop page (4 posts)

  1. LV2013
    Member
    Posted 1 year 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 1 year ago #

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

  3. assilem1986
    Member
    Posted 11 months ago #

    Hi there!! im looking for the same here!

  4. Bradford Nelson
    Member
    Posted 11 months 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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Page Restrict
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic