Banner Logo

Be a part of the family: Connect, Receive Support,
Contribute, and Reap Abundant Rewards!

Hide category for vendor when adding a product

MultivendorX Pro

Open
Viewing 5 reply threads
  • Author
    Posts
    • #215768
      Sergio Wong Chung
      Participant

      Hello,
      We’re trying to hide some product categories so that sellers are unable to select those to add their products in
      We found the following code in your forums to do this:
      We tried adding it as a snippet in a snippet plugin (our preffered way) and in functions.php of our theme but both didn’t work

      add_filter( ‘mvx_vendor_product_classify_first_level_categories’, ‘mvx_vendor_product_cat_remove’);
      function mvx_vendor_product_cat_remove($cat_array) {
      $cat_array[‘exclude’] = array(15); // add category id here separated by comma
      return $cat_array;
      }

      We changed the category ids to ours but it does not seem to hide it for the vendor when making a new product which means they’re still able to add a product in those categories
      How can we fix this?
      Thank you

    • #215770

      Sergio, I presume you are using wrong coding syntax of comma, please use this updated one :

      add_filter('mvx_vendor_product_classify_first_level_categories', 'mvx_vendor_product_cat_remove');
      
      function mvx_vendor_product_cat_remove($cat_array) {
          $cat_array['exclude'] = array(15); // add category id here separated by comma
          return $cat_array;
      }
      Copy
    • #215773
      Sergio Wong Chung
      Participant

      Hello,
      Thank you for your quick reply
      We tried the new code with the other syntax for commas
      Its the same as we tried before but it pasted it differently in my message, thats why the comma’s were wrong in my message

      It is however still not working for us, the categories we dont want to see are still shown in the vendor admin when adding a product

    • #215793

      Hello @Sergio Wong Chung, The earlier provided code will remove the category from the CPG(http://tinyurl.com/yvorlxcu) in the vendor end(http://tinyurl.com/yrmmjkw3).
      Now as you are not using CPG on your end, kindly share the access of your site with us and let us know which categories you want to remove for the vendors.
      We will add that modification on your end accordingly.

    • #215800
      Sergio Wong Chung
      Participant
      This reply has been marked as private.
    • #215817

      Thank you for providing access.
      Our team tried to hide the certain categories for vendors using custom CSS, but faced some issues as it was not a permanent solution. As we do not have any filter for the category section in the add product page currently, hence hiding categories using custom code at this moment is not possible.
      However, rest assured, we plan to introduce a filter for this section in our upcoming update. After implementation, we will furnish you with the corresponding code to hide specific categories from vendors.
      For now please use the CPG flow on your end and use the earlier shared code on your end to hide the categories from the vendor.

Viewing 5 reply threads

Please LOGIN to reply to this topic