WooCommerce Visibility

Thank you for purchasing our plugin.

If you have any questions that are beyond the scope of this help file, please leave a message at the plugin's comment section at codecanyon.

Don't forget to rate the plugin if you like it.

Thank you so much!

Overview

With WooCommerce Visibility plugin you can decide which products will be visible site-wide for each user role.

Minimum requirements

  • PHP 5.4
  • WordPress 4.4
  • WooCommerce 2.3
  • JavaScript / jQuery

Features

  • Hide or show specific products for each user role
  • Hide or show products based on tag for each user role
  • Hide or show products based on category for each user role
  • Hide or show products based on attributes (eg. color, size, etc.) for each user role
  • Hide or show products based on custom taxonomies (eg. brands) for each user role
  • Combine product, tag or category rules for each user role
  • Hide products, categories and tags both at the same time for particular role
  • Hide products, categories and tags from menus, widgets and cart
  • Hide or show payment methods for each user role
  • Hide or show shipping methods for each user role
  • Compatible with custom user roles
  • Compatible with multiple user roles
  • Show products through direct URL option
  • Default logged user role for bulk actions
  • Reset all rules button
  • Toggle role visibility on backend to avoid clutter
  • Quick-view which user roles have visibility rules at a glance
  • Object Oriented Code
  • WPML Compatible
  • Multilingual Ready: .pot file included, for easy translation (RU, UA contributed by users)

Installation

There are two primary methods for installing any WordPress plugin.

Install with a zip file

  1. From your WordPress dashboard, choose Plugins > Add New
  2. Select Upload from the set of links at the top of the page (the second link)
  3. From here, browse for the zip file included in your plugin purchase titled woocommerce-visibility.zip and click the Install Now button
  4. Once installation is complete, click Activate Plugin to activate it and enable its features.

Install by FTP Manager

If you are have no previous web experience and have no idea what an FTP Manager is, then this option is not for you.

  1. Access your host through the FTP manager
  2. Access the plugins directory of your WordPress install /(WordPress directory)/wp-content/plugins/

    If WordPress is installed on the root folder the directory is /wp-content/plugins/

  3. Find the directory titled woocommerce-visibility.zip and upload it and all files within to the directory from the previous step.
  4. From your WordPress dashboard, choose Plugins > Installed Plugins
  5. Locate the newly added plugin and click on the Activate link to enable its features.

Quick Start Guide

Step 1

Activate the plugin and click the WooCommerce > Settings > Visibility tab.

In this page you can select the visibility mode or modes you want to enable.

WooCommerce Product Visibility

Let's say that we want to hide some products for specific user roles. First, we have to set the mode on, so that we can set our rules. To do so, set the Enable Products Visibility switch to on and click Save changes on the bottom.

WooCommerce Product Visibility

To go the rules' settings page, click the Products Visibility button.

WooCommerce Product Visibility

Step 2

Next, click any of the user roles to start adding rules.

The last role, guest, refers to all users that are not logged in.

If you want to add more user roles, you can download, install and activate the User Role Editor plugin.

WooCommerce Product Visibility

Step 3

By clicking the role, a sub-part will unfold. You can now add your desired rules to the selected user role.

You can see 4 sections for each user role: products, tags, categories and custom taxonomies.

  1. In the products section, you can select which products will be visible or hidden for the select role.
  2. In the tags section, you can select which products will be visible or hidden for the select role, based on their tag.
  3. In the categories section, you can select which products will be visible or hidden for the select role, based on their category.
  4. In the custom taxonomies section, you can select which products will be visible or hidden for the select role, based on their custom taxonomy. Which may be a brand or a product attribute (like color, size, etc.)

You can also simultaneously combine rules. In that case, bear in mind that:

  1. The 1st rule that refers to the products, has top priority. This means that it will override the 2 consequent rules (tag and categories).
  2. The 2nd rule that refers to the tags, has a lower priority and will override the categories and custom taxonomies rule.
  3. The 3rd rule that refers to the categories, has a lower priority and will override the custom taxonomies rule.
  4. The 4th rule has the lowest priority.

For more examples, you can see the manual section Use Cases.

Step 4

After having selected the desired rules for each user role, press Save Changes at the bottom to apply changes.

For your convenience, user roles that have at least one rule active, will be highlighted. This way, you can quick-view which user roles have visibility rules at a glance!

WooCommerce Product Visibility

Step 5

You can now go to your front-end, logged in as the desired user to confirm that you have applied the correct rules.

The Default Logged User

The Default Logged User role is a helper role that helps you add bulk rules to the logged-in roles. This means that if you add a rule to this role, all the other roles (eg. administrator, editor, shop manager, etc.), except for guest, will inherit these rules.

WooCommerce Product Visibility

The Cancel Hide radio button

When you add a rule to the default user role, a new radio button will appear for all the other roles (except for guest): the cancel hide button. By using this button, you can cancel some of the rules that you may have added in the default user role for the desired roles.

The cancel hide button will show, only if you have set a rule to the default user role.

A practical example

For example, let's say that you want to hide a specific category, let's say albums, from all users (logged and guests). But at the same time, you want to show this category to a specific role, let's the say wholesale role.

To do so you can follow these easy steps:

  1. Hide the albums category for the default logged users.
  2. Hide the albums category for guest users.
  3. Cancel hide the albums category for the wholesale users.

The Reset Button

If you want to erase all your rules simultaneously, you can press the reset button on the bottom right corner. Since this action is irreversible, a confirmation box will appear and ask you to verify your action. The reset action also remove all the role priorities to their default values (50).

WooCommerce Product Visibility

Use Cases

For demonstration purposes, let's say that we want to add some visibility rules for guest users and that we have the following 6 products with their corresponding tags and categories:

Product Tag Category
Trouser 1 Winter Trousers
Trouser 2 Summer Trousers
Shoe 1 Spring Shoes
Shoe 2 Winter Shoes
Dress 1 Summer Dresses
Dress 2 Spring Dresses

For each case, you will see:

  1. An image preview of the backend settings to achieve the case's desired result.
  2. A table that describes which of the products will be visible and which not.

Case 1:

Hide dresses category

WooCommerce Product Visibility
Product Tag Category Visible
Trouser 1 Winter Trousers True
Trouser 2 Summer Trousers True
Shoe 1 Spring Shoes True
Shoe 2 Winter Shoes True
Dress 1 Summer Dresses False
Dress 2 Spring Dresses False

Case 2:

Show only winter tag

WooCommerce Product Visibility
Product Tag Category Visible
Trouser 1 Winter Trousers True
Trouser 2 Summer Trousers False
Shoe 1 Spring Shoes False
Shoe 2 Winter Shoes True
Dress 1 Summer Dresses False
Dress 2 Spring Dresses False

Case 3:

Hide all products from category shoes, except for shoe 1

WooCommerce Product Visibility
Product Tag Category Visible
Trouser 1 Winter Trousers True
Trouser 2 Summer Trousers True
Shoe 1 Spring Shoes True
Shoe 2 Winter Shoes False
Dress 1 Summer Dresses True
Dress 2 Spring Dresses True

Case 4:

Show only shoes and dresses, except for shoe 1 and products that have summer tag

WooCommerce Product Visibility
Product Tag Category Visible
Trouser 1 Winter Trousers False
Trouser 2 Summer Trousers False
Shoe 1 Spring Shoes False
Shoe 2 Winter Shoes True
Dress 1 Summer Dresses False
Dress 2 Spring Dresses True

Case 5:

Hide summer tag and trousers category, but show dress 1 and trouser 2

WooCommerce Product Visibility
Product Tag Category Visible
Trouser 1 Winter Trousers False
Trouser 2 Summer Trousers True
Shoe 1 Spring Shoes True
Shoe 2 Winter Shoes True
Dress 1 Summer Dresses True
Dress 2 Spring Dresses True

General Settings

Our plugin is so intuitive that you can select between 4 modes:

  1. Hide products and taxonomies
  2. Hide prices and add to cart button
  3. Hide payment methods
  4. Hide shipping methods
WooCommerce Product Visibility

If you enable a mode and Save Changes, a new tab will be created where you can add your rules.

Below, you can see an example where we have activated only the payment and shipping method.

WooCommerce Product Visibility

Products/Taxonomies Settings

These settings will only show if you select the Hide products and taxonomies mode. Don't forget to click the Save changes button, after having made the desired changes.

WooCommerce Product Visibility
Show Products Through Direct URL

If for some reason, want to hide your products, but be able to send a direct url to your users, in order for them to see the hidden products, just enable this option.

Show Archive Through Direct URL

If for some reason, want to hide your categories or taxonomies, but be able to send a direct url to your users, in order for them to see the hidden categories or taxonomies, just enable this option.

Apply rules on menus

By default, our plugin hides products, categories and taxonomies from your menus. If you want to show them instead, you can disable this option.

Hide empty categories/tags/taxonomies

Let's say that you have a product that has a tag "test" on it. And let's say that this tag, only belongs to this product. If you hide this product, the tag will be empty (since no other products have this tag), which means that, by default, the tag will be hidden too. This goes the same for all other entities (like categories, taxonomies, etc.). If you want to show these other entities, you can disable this option.

Change Categories Product Count

In your site, you may have product counting in various places (eg. widgets). Take for example the following picture. You see product counts at two places: a widget and the archive.

WooCommerce Product Visibility

In order for the counting to be correct after hiding some products, you must set this option to on. Only set it to on, if you have counting anywhere at your site. If not, set it to off, to improve performance. In the following example, we hide just one product. You see that the counting is updated.

WooCommerce Product Visibility

Prices/Add to Cart Settings

These settings will only show if you select the Hide prices and add to cart button mode. Don't forget to click the Save changes button, after having made the desired changes.

WooCommerce Product Visibility
Hide price

Enable if you want to hide prices on your site.

Hide Add to cart button

Enable if you want to hide add to cart buttons on your site.

Hide sales price

Enable if you want to hide sale prices on your site.

Payment Methods Settings

If you want to hide payment methods by user role, you can set the Enable Payment Methods Visibility switch to on and click Save changes on the bottom.

To go the rules' settings page, click the Payment Methods Visibility button.

WooCommerce Product Visibility

Shipping Methods Settings

If you want to hide shiping methods by user role, you can set the Enable Shipping Methods Visibility switch to on and click Save changes on the bottom.

To go the rules' settings page, click the Shipping Methods Visibility button.

WooCommerce Product Visibility

Advanced Settings

Multiple Roles per User Compatibility

The plugin is compatible with multiple roles per user.

If you want to add multiple user roles per user, you can download, install and activate the Multiple Roles plugin.

To enable the multiple roles compatibility, just tick the enable radio button and press Save changes.

The Role Priority field

When you enable the multiple roles compatibility, then a new field will appear for each role: the Role Priority field.

The Role Priority field is an integer number (1 or greater) that indicates which role rules will be applied first. Bear in mind, that the default logged user has a top priority of -1.

To understand role priorities, let's say that a user has 2 different roles at the same time: the editor and the author. If the editor role has a default priority of 50 and the author role a priority of 51, this means that the editor rules will be applied first.

The Role Priority field will show, only if you have enabled the Multiple User Roles Compatibility.

A practical example

Let's say that you add the following rules:

  1. Hide posters for editors
  2. Hide albums for customers

The result will be the following:

  1. The editors will not see the posters
  2. The customers will not see the albums
  3. Users that have the editor and customer role at the same time, will not see the posters and the albums
The Cancel Hide Radio Button

If you add multiple roles to at least one user, then a new radio button will appear for each role: the Cancel hide button.

You can use the cancel hide rule to reset a hide rule that belongs to a higher priority role.

In order to use the cancel hide button, the user role to which you will apply it must have a higher number (lower priority) than the role to which you have set the hide rule.

A practical example

For example, let's say that you have a user that has 2 user roles at the same time, the editor and the customer. In order to hide all posters from editors, but show it for customers you can do follow these steps:

  1. Hide the albums category for editors.
  2. Set a 51 priority for customers (the editors have a default 50 priority).
  3. Cancel hide the albums category for customers.
Cancel Hide and Show combination

When you add a show rule to a product, tag or category, it helps if you interpret this rule as a hide all others rule. For example, if you have 4 products, and you add a show rule for products 1 and for, this means that the other products, 3 and 4, will be hidden.

A practical example

Let's say that you add the following rules:

  1. Show only products 1 and 2 for editors with a role priority of 50
  2. Cancel hide product 3 for customers with a role priority of 51

The result will be the following:

  1. The editors will see products 1 and 2 (since all other products will be hidden)
  2. Users that have the editor and customer role at the same time, will see products 1, 2 and 3

WPML Compatibility

The plugin is WPML compatible. This means, that every rule that you create will also apply for the available translations.

The plugin's backend options are only available for the site's default language.

Make sure that all of your products, tags and categories on your default language, have been translated.

Changelog

11.01.2021 version 4.6

  • Fix - Compatibility with Wordpress 5.6
  • Fix - Bug fix for hide prices for variable products

06.11.2020 version 4.5

  • Fix - Bug fix for hide add to cart button for variable products

23.09.2020 version 4.4

  • Fix - Bug fix for Show Archive Through Direct URL option

10.08.2020 version 4.3

  • Fix - Remove PHP notice

20.06.2020 version 4.2

  • Fix - Make plugin compatible with upsell products

11.05.2020 version 4.1

  • Fix - Do not remove tags when showing only one category (with hide only selected)

21.04.2020 version 4.0

  • Add - Option to hide payment methods per user role
  • Add - Option to hide shipping methods per user role
  • Add - Add different rules to all 4 modes (products, prices, payment, shipping) at the same time
  • Add - Change Categories Product Count option for product hiding

26.01.2020 version 3.8

  • Fix - Hide price fix

22.01.2020 version 3.7

  • Fix - Backend select for variations fix for new order

22.08.2019 version 3.6

  • Fix - Show archive through direct URL fix

19.07.2019 version 3.5

  • Add - Filter for product attributes

20.06.2019 version 3.4

  • Fix - Bug with empty categories or tags that are contained inside rules

14.05.2019 version 3.3

  • Fix - Hide variation add to cart button

29.01.2019 version 3.2

  • Add - Helper filters

23.11.2018 version 3.1

  • Add - General settings page
  • Add - Hide prices and add to cart button mode
  • Add - Hide price option
  • Add - Hide add to cart button option
  • Add - Hide sales price option
  • Add - Enable rules on cron jobs option
  • Add - Apply rules on menus option
  • Add - Hide empty categories/tags/taxonomies option

17.11.2018 version 3.0

  • Add - Compatibility with custom taxonomies (eg. brands, attributes, etc.)

28.09.2018 version 2.13

  • Fix - Minor fixes

25.07.2018 version 2.12

  • Fix - WooCommerce related products fix

18.07.2018 version 2.11

  • Add - Helper filter

13.06.2018 version 2.10

  • Fix - YOAST SEO plugin sitemap exclude hidden products

06.06.2018 version 2.9

  • Fix - Apply change count for categories only if get_terms does not include products
  • Fix - If Show products through direct URL is enable, do not remove hidden products from cart

17.05.2018 version 2.8

  • Fix - Compatibility fix with WOOF product filter ajax

27.04.2018 version 2.7

  • Add - Multiple user role wcpv_mur_intersect_include filter

20.02.2018 version 2.6

  • Add - General helper filters

02.02.2018 version 2.5

  • Add - Helper filter for multi-category products

02.09.2017 version 2.4

  • Add - Show products through direct URL option

14.05.2017 version 2.3

  • Fix - Relevanssi search plugin compatibility fix
  • Fix - Live ajax search fix

20.04.2017 version 2.2

  • Fix - Performance optimization

01.04.2017 version 2.1

  • Add - Compatibility with WooCommerce 3.0

01.03.2017 version 2.0

  • Add - Multiple user roles per user compatibility
  • Add - Default logged user role added for bulk actions
  • Add - Hide hidden products from cart
  • Add - Reset all rules button
  • Fix - Performance optimization
  • Language - Fix Russian and Ukrainian translations

24.01.2017 version 1.4

  • Fix - Do not hide irrelevant products from menus and widgets
  • Fix - Performance optimization

13.01.2017 version 1.3

  • Add - Hide hidden products from menus
  • Fix - Do not hide post categories

12.01.2017 version 1.2

  • Add - Hide hidden categories and tags from menus
  • Add - Hide hidden categories from WooCommerce Product Categories widget
  • Add - Fix categories counting in WooCommerce Product Categories widget
  • Add - Hide hidden tags from Product Tags widget
  • Language - Plugin localization
  • Language - Add Russian and Ukrainian translations

29.12.2016 version 1.1

  • Fix - WPML problem with categories and tags

26.10.2016 version 1.0

  • Initial release