How to Set Up Product or Category Visibility

Step 1) Enable product visibility #

To begin configuring product visibility, the first step is to go to B2BKing->Settings->Access Restriction and choose "Control Visibility" (disable "All products visible"). This allows you to set product visibility by category or product.

Set to "Control Visibility"

Step 2) Set product visibility per category #

Go to each WooCommerce category and scroll down to Group Visibility rules:

Group visibility settings per category

Check each option per your needs and save settings.

Step 3) Optional: Set individual visibility settings for products #

You can set visibility not only per category, but also for each individual product. To do this go to the Edit product page, and scroll down to product visibility settings:

Product visibility settings

To set visibility for the product individually, change "Follow category rules (Default) to "Manual Setting". This will allow you to set visibility settings for each group:

Optional: Make all categories visible in bulk #

By default, when you first configure visibility, B2BKing will automatically make all categories visible. However, if you add more categories later on, you may need to manually set this.

You can make all categories visible in bulk by going to B2BKing->Tools->Visibility Editor, choosing "All categories visible to ALL" and clicking on "Set all categories":

Advanced Visibility Settings #

If you go to B2BKing -> Settings -> Other, you will find advanced visibility settings:

  • Product Visibility Cache
  • Hidden Has Priority
Advanced Visibility Settings in B2BKing

Let's see what these do.

First of all, the "product visibility cache" setting basically caches a list of which products are visible for each user. This can have a significant effect on maintaining good performance when using visibility. It also helps apply visibility at a deeper level and may help hide products and categories in places where they're otherwise visible.

"Hidden has priority" modifies how visibility is calculated when a product is part of multiple categories. By default, products are visible if they are part of at least 1 visible category. With this setting enabled however, products will be hidden if they are part of at least 1 hidden category. Unless necessary in your setup, we generally recommend keeping this disabled.

Common Issues #

A common situation that occurs when using visibility is seeing that products are hidden, but categories are not. Often this can be resolved by enabling the product visibility cache.

However, that does not always work, and it will depend on the specific element, menu, widget that displays categories and how it works.

In cases where that does not work, the issue can usually be resolved by adding group-specific CSS to hide elements. We can assist you with writing the correct CSS via support.

Hiding Variations #

While this feature can hide products and variable products completely, it cannot hide individual variations.

However, what can be done is to create a “hidden price” dynamic rule for an individual variation, making it unavailable for purchase and showing a message such as “this product is not available”, or “this product is only available for B2B buyers”.

The add to cart button would then be greyed out and the customer would not be able to add the product to cart.

"Hidden price" variation applied to specific variations only.

Set product visibility with Meta Data #

All visibility settings are added through product or category meta data. Therefore you can also import visibility or modify it programmatically. Here's how that works:

1. Meta keys for a category:

  • b2bking_group_0  - sets category visibility for guests
  • b2bking_group_b2c - sets category visibility for logged in, b2c users
  • b2bking_group_GROUPID (for example b2bking_group_73) - sets category visibility for the group with ID 73

Meta value: the value can be 1 for visible and 0 for invisible

2. Meta keys for a product:

  • b2bking_product_visibility_override : sets whether visibility is set by category, or manually.

Meta value: the value can be default (corresponds to "follow category rules") or manual (corresponds to manual visibility)

3. Meta keys for manual product visibility:

  • b2bking_group_0
  • b2bking_group_b2c
  • b2bking_group_GROUPID 

These work the same way as category meta data.

Powered by BetterDocs