Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Marketplace (WooCommerce Multivendor Marketplace) › Add To My Store Catalog: Show Only Admin Products
Tagged: store-manager admin products
- This topic has 3 replies, 3 voices, and was last updated 3 years, 9 months ago by Inversiones Strawberry.
- AuthorPosts
- April 10, 2020 at 10:36 pm #117764VirtualVendorParticipant
Hi,
the “Add To My Store” Catalog lists products created by the admin and other store managers. How can I hide products from other store managers and only show the ones created by the admin?
In addition, I need to remove the “Add To My Store” Button on other vendor’s products.
Is this possible?
Thanks! - April 12, 2020 at 1:34 pm #118376WCFM ForumKeymaster
Hi,
Sure, please add this snippet to your site for the purpose-
add_filter( 'wcfm_sell_items_catalog_args', function( $args ) { if( isset( $args['author__not_in'] ) ) unset( $args['author__not_in'] ); $args['author'] = 1; return $args; }, 50 ); add_filter( 'wcfmmp_is_allow_single_product_multivendor_by_product', function( $is_allow, $product_id ) { global $WCFM, $WCFMmp, $product, $post; $product_author = wcfm_get_vendor_id_by_post( $product_id ); if( $product_author ) { $is_allow = false; } return $is_allow; }, 50, 2 );
Add this code to your child theme’s functions.php
In case you do not have child theme then add code using this plugin – https://wordpress.org/plugins/code-snippets/Thank You
- April 12, 2020 at 7:17 pm #118454VirtualVendorParticipant
This works perfectly! Thank you!
- July 1, 2020 at 3:04 am #145357Inversiones StrawberryParticipant
Is it possible to allow products created by a certain User ID?
- AuthorPosts
- You must be logged in to reply to this topic.