Okay
  Public Ticket #2673985
Hide Product Category
Closed

Comments

  •  3
    Dimitrios Dellis started the conversation

    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,214
    WebWizards replied

    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://woocommerce-b2b-plugin.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://woocommerce-b2b-plugin.com/docs/how-to-add-a-snippet-php-or-js/


    Kind Regards,

    Stefan

  •  3
    Dimitrios Dellis replied

    wow!

    A whole new world starts for me right now. This is a excellent functionality!

    Thank you so much:-)