Claim your freedom to choose the perfect partner for your multi-vendor journey.

FREEDOM25

Celebrate the festive season by giving your marketplace a powerful lift!

FESTIVE20

5.0.0
Something big is coming for marketplace admins… MultiVendorX 5.0 is almost here. Are you ready?
Be the first to explore all the game-changing features!
Power your marketplace dreams with unbeatable Black Friday deals!

MVXBLACK30

Supercharge your marketplace vision with unstoppable Cyber Monday deals!

MVXCYBER30

Holiday cheer, bigger savings
Take 25% off-because your marketplace deserves a gift too.

happyholiday

Hide category for vendor when adding a product

Resolved
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;
      }
    • #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(https://tinyurl.com/yvorlxcu) in the vendor end(https://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
  • The topic ‘Hide category for vendor when adding a product’ is closed to new replies.
Shopping Cart
Scroll to Top