Visibility Control for WooCommerce

plugin banner

Visibility Control for WooCommerce helps you hide messages, menu and content for specific criterion anywhere on your WordPress page.

Author:Next Software Solutions (profile at wordpress.org)
WordPress version required:4.0
WordPress version tested:6.4.2
Plugin version:1.4
Added to WordPress repository:15-02-2020
Last updated:26-12-2023
Rating, %:100
Rated by:2
Plugin URI:https://www.nextsoftwaresolutions.com/woocomm...
Total downloads:1 929
Active installs:100+
plugin download
Click to start download

Visibility Control for WooCommerce helps you hide or show messages, menu and content for specific criterion anywhere on your WordPress page.

You can show/hide HTML elements, menus, and other details based on:
1. User’s purchase of a particular WooCommerce Product or Variation, Or
2. User is Logged In or Logged Out.

You simply need to add a CSS class to your element div or span. As explained here:

Example:

If Product or Variation ID is 123

  • To show the element/menu item to user who purchased above product, add this CSS class: visible_to_product_123
  • To hide the element/menu item from user who purchased above product, add this CSS class: hidden_to_product_123
  • To show the element/menu item to a logged-in user, add this CSS class: visible_to_logged_in OR hidden_to_logged_out
  • To hide the element/menu item from a logged-in user, add this CSS class: visible_to_logged_out OR hidden_to_logged_in

For user’s role:
* To show the element/menu item to a user will role administrator, add this CSS class: visible_to_role_administrator OR hidden_to_role_administrator
* Note: To show an element to multiple specific roles only, you need add the element multiple times, one for each role. To hide an element/menu from specific multiple roles only you can add the element once add multiple classes to the same element.

Mechanism of Functioning

  • Multiple CSS Classes: If multiple visibility control classes are added, ALL of them must meet the criterion to keep the element visible. If any one of them hides the element, it will be hidden. For example: visible_to_product_123 visible_to_product_124 will show the element only to those who have purchased to both products.
  • Hidden data/elements reaches the browser. Though user’s do not see it.
  • CSS is added to the page for all CSS elements that needs to be hidden based on above rules.
  • After page is loaded. These elements are removed from page using jQuery (if available), so it won’t be available even on Inspect.
  • Elements rendered after the page load are hidden but not removed from DOM/page.

Future Development

Depending on the interest in this feature, we will decide on adding a setting, shortcode and/or a Gutenberg Block option to achieve this feature.

Other Visibility Control Plugins:


Screenshots
FAQ
ChangeLog