• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Hide Woocommerce store from non-logged in visitors

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Hide Woocommerce store from non-logged in visitors

This topic is: resolved

Tagged: block, format, template, WooCommerce

  • This topic has 1 reply, 1 voice, and was last updated 10 years, 1 month ago by Tal.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • January 15, 2016 at 4:15 am #176557
    Tal
    Member

    I want to restrict access to a woocommerce store to people who are logged in to the site. I've tried a variety of options (including s2members plugin and adding a redirect code in functions.php that will redirect to another page if a user tries to access the page "shop" without being logged in) with no success so far. These options work fine for OTHER pages on the site, just not the store page.

    I did work out I can do it if I copy the woocommerce template pages to a woocommerce folder within my theme and then add the following code to the desired template pages

    if( !is_user_logged_in() ) {
    	wp_redirect('URL of page to redirect to');
    }
    

    but the problem with that is it seems to bypass the Genesis Connect for WooCommerce plugin so the store pages that use the template files in my theme woocommerce folder display with the sidebar below the content instead of to the right, which is what happens if I don't have the Genesis Connect for WooCommerce plugin installed.

    Does anyone know how else I can block access to my store pages AND still have the layout fixes genesis woocommerce connect provides?

    Thanks

    January 15, 2016 at 4:26 am #176561
    Tal
    Member

    Figured it out. I needed to copy the template folders from the genesis woocommerce connect plugin into my theme folder, not from the main woocommerce plugin folder

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Hide Woocommerce store from non-logged in visitors’ is closed to new replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble