Can I restrict the product table so that only registered/logged in users can see it?
Some of our customers want to hide their product tables from guest users, so that only registered or logged in users can see it. This isn’t a feature of WooCommerce Product Table, but we have other plugins that you can add to achieve this:
How to hide your whole WooCommerce store
Our WooCommerce Private Store plugin can be used to restrict your entire store to logged in users, so that guests can’t see it at all.
- Install WooCommerce Private Store and tick the ‘Logged In Users‘ box on the plugin settings page. This will restrict your store so that only logged in users can see it.
- By default, WooCommerce Product Table doesn’t work with WooCommerce Private Store because you add the tables to normal pages instead of WooCommerce-specific areas. You can get around this by adding product tables to the main shop page or category archive template.
How to hide specific parts of your WooCommerce store only
Our WooCommerce Protected Categories plugin lets you hide specific categories within your store. For example, some of our customers have a public area of their site and a separate wholesale area with product tables. You can achieve with WooCommerce Product Table as follows:
- Install WooCommerce Protected Categories and password protect one or more categories.
- Add product tables to your category archive pages by following the instructions in this article.
Please note that the above instructions will add product tables to all your product categories, including the public ones. You would need to do some custom coding to show product tables on specific categories only. This is advanced usage and doesn’t come under our standard plugin support. If you don’t know how to do this, we recommend that you post a job on Codeable to find a suitable WordPress developer. We have partnered with them to provide customizations for our customers.
How to show different products in the table to different users or roles
Some of our customers like to have a single product table that displays different products to different people. You can do this by using WooCommerce Product Table with our WooCommerce Protected Categories plugin to restrict which categories each user or user role can access:
- Install WooCommerce Protected Categories and restrict one or more categories so that only specific logged in users or roles can see them.
- On the WooCommerce Protected Categories plugin settings page (Settings -> WooCommerce → Products → Protected Categories), untick the option to show protected products in public parts of the store. This ensures that each user will only see the products they have access to.
- On the WooCommerce Product Table settings page (WooCommerce → Settings → Products → Product Tables), make sure the caching option is disabled. This ensures that the table is newly loaded for each user, otherwise some people could see a cached version containing the wrong products.
- Add a product table to any page on your site. Each user will only see the products in categories that they have access to.
Can I hide prices from guests?
Please see our other article on hiding prices unless the user is logged in.
Creating password protected categories
The WooCommerce Protected Categories plugin also lets you create password protected categories. This is a good option if you want people without their own user account to be able to access your protected products.
We’ve provided a demo site where you can test drive password protected categories. When you enter the correct password for a category, you are directed to the category page with a product table layout.