Prevent products in a specific category from being shown in vendor\'s dashboard

We're shifting our Forum based support to a more dedicated support system!

We'll be closing our Forum support from 10th June, 2020 and move to Email Support assistance.

  • If you are a WCFM premium add-ons user, contact us- here
  • Want to know more before buying our add-ons? Send Pre sale queries- here
  • If you are a WCFM free user, please open a support ticket at WordPress.org
  • For WCFM App related queries, reach us- here
From now the forum will be read-only!

Multi Vendor Marketplace Plugin | WCFM Marketplace Forums WCFM Prevent products in a specific category from being shown in vendor\'s dashboard

Tagged: 

Viewing 2 reply threads
  • Author
    Posts
    • #133144
      mishareed
      Participant

      Hi – I have a product for gratuity that I add to each of my vendor’s product catalogs. To allow billing and refunds to work properly, I need the product to be listed in the vendor’s store, but I don’t want them to be able to view or modify the product. Is there a way to prevent products from a specific category from being show in the vendor’s product list?

      Thanks!

    • #133467

      Hello,

      You can set product capability for vendor, only turn on “manage products” from capability, then the vendor can not modify the products.(PFA)

      Is there a way to prevent products from a specific category from being show in the vendor’s product list?
      >>What we understand that you want some products(with specific category) will not display in vendor’s dashboard product manager but will display in vendor’s store page.
      For this, It’s not feasible to hide those products, but it’s possible to prevent edit/modify those products.
      Try the below code in your theme’s functions.php

      add_filter( 'wcfm_is_allow_edit_specific_products', 'wcfm_is_allow_edit_specific_products_2005', 10,2 );
      function wcfm_is_allow_edit_specific_products_2005( $bool, $product_id ) {
         $term_list = wp_get_post_terms($product_id, 'product_cat', array('fields' => 'ids'));
         if (in_array(15, $term_list)){ //replace 15 with your specific product category id   		
         	 $bool = false;
         }
         return $bool;
      }

      Thanks.

      Attachments:
      You must be logged in to view attached files.
    • #133575
      mishareed
      Participant

      Thanks! The function worked to prevent most editing. The products can still be edited using the bulk update functionality, but I was able to work around that. Thanks again for your help.

Viewing 2 reply threads
  • You must be logged in to reply to this topic.