MultivendorX Pro
Tagged: categories, hide, Multivendorx pro
-
AuthorPosts
-
-
January 4, 2024 at 6:35 PM #215768Sergio Wong ChungParticipant
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 workadd_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 -
January 4, 2024 at 7:17 PM #215770NerdySupportExpert MoumitaKeymaster
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 -
January 4, 2024 at 7:34 PM #215773Sergio Wong ChungParticipant
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 messageIt 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
-
January 5, 2024 at 12:38 PM #215793Sangita Support SquadKeymaster
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. -
January 5, 2024 at 3:33 PM #215800Sergio Wong ChungParticipantThis reply has been marked as private.
-
January 5, 2024 at 4:34 PM #215817Sangita Support SquadKeymaster
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.
-
-
AuthorPosts
Please LOGIN to reply to this topic