Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Ultimate › How do I set a vendors products to NOT show up anywhere but in the vendors store
- This topic has 1 reply, 2 voices, and was last updated 4 years, 10 months ago by WCFM Forum.
Viewing 1 reply thread
- AuthorPosts
- May 26, 2019 at 4:22 pm #63847cornerstonewebdevelopersParticipant
I want to exclude one of my vendors products from being searched by the sitewide product search. You provided a way to exclude vendor(s) from showing up on the “store list page” using the exclude parameter for wfcm_stores. I want to do the same thing with their products. I do not want their products visible anywhere, but at their store URL. I have spent several hours searching with no success.
- May 29, 2019 at 4:48 am #64195WCFM ForumKeymaster
HI,
Already provided solution over email.
This code snippet require –
add_action( 'woocommerce_product_query', function( $query, $that ) { $wcfm_store_url = get_option( 'wcfm_store_url', 'store' ); $store_name = urldecode( get_query_var( $wcfm_store_url ) ); if ( !is_admin() && $query->is_main_query() && empty( $store_name ) ) { $query->set( 'author__not_in', array(2) ); // Replace 2 with your Vendor ID } }, 20, 2 );
Thank You
- AuthorPosts
Viewing 1 reply thread
- You must be logged in to reply to this topic.