Public Ticket #2673985

Hide Product Category

Closed
Comments
2 Tickets 3
Dimitrios Dellis started the conversation 6 years ago on January 28, 2021 at 12:18pm

Hello.

I get it, when i choose hide product category for specific group, hides all the products that are related to this category. This is perfect.

But.... Is it possible to hide the product category from the widget menu as well?

Have a look here: https://myurbandrops.com/shop/

because you are not logged in you can see all the product categories. I would like to hide the wholesale category from the widget menu at the left.

Is it possible?

thank you

2,762
KingsPlugins replied 6 years ago on January 28, 2021 at 4:59pm

Hello Dimitrios,

The plugin doesn't have a functionality to hide menu items.

What you could do is to hide menu items by using CSS - by using a code snippet you can hide items for specific users/groups. We have a guide for this at the bottom of this article: https://b2bkingplugin.com/docs/shortcode-to-restrict-content-to-b2b-b2c-user-groups-specific-users/

In your site, this code snippet will hide "wholesale" for logged out users:

// Apply CSS for Logged Out users only
add_action('wp_head','b2c_only_css');
function b2c_only_css(){
   // check that user is not B2B
   if (!is_user_logged_in()){
      ?>
      <style>
      .cat-item-287{
          display:none;
      }
      </style>
    <?php
      }
}

To add a code snippet, we have a guide here: https://b2bkingplugin.com/docs/how-to-add-a-snippet-php-or-js/

Kind Regards,

Stefan

Sign In