Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WC Marketplace › Hide products tab on store page if no products
- This topic has 12 replies, 4 voices, and was last updated 5 years, 3 months ago by WCFM Forum.
- AuthorPosts
- August 6, 2019 at 9:14 am #75437
- August 9, 2019 at 7:24 am #75876WCFM ForumMember
Hi,
Sorry, this is not possible. Products is default tab for Store page.
Well, you may hide those stores from store list which not yet have any products.
Use short code like this –
[wcfm_stores has_product="yes"]
Thank You
- August 9, 2019 at 8:07 am #75880nictParticipant
Ah I need those stores to be on the list though. Is there a way to reorder the tabs so that The products tabs isn’t the first tab?
- August 12, 2019 at 8:56 am #76210WCFM ForumMember
Hi,
Is there a way to reorder the tabs so that The products tabs isn’t the first tab?
– Well, it’s possible to re-arrange store tabs, but product tab should the first one.
Thank You
- August 12, 2019 at 9:46 am #76231nictParticipant
lol i get that but in my specific case it would be better to not display the products tab for a certain vendor group, and if not possible to hide it, at least make it so that I don’t have it displayed as the first tab. So if you have some snippet for me to use in order to achieve that ( ? ), that would be great and much appreciated.
- August 14, 2019 at 12:19 pm #76589Sarmistha ChakrabortyMember
Hi,
Try this code to hide the products tab on the vendor’s store page if the vendor has no products
add_filter( 'wcfmmp_store_tabs', 'new_wcfmmp_store_tabs',90,2); function new_wcfmmp_store_tabs($store_tabs, $vendor_id) { if(get_wcfm_vendor_have_product($vendor_id) < 1) { unset($store_tabs['products']); } return $store_tabs; } add_filter('wcfmp_store_default_query_vars',function($tab,$vendor_id){ if(get_wcfm_vendor_have_product($vendor_id) < 1) { return 'about'; } else { return 'products'; } },20,2); function get_wcfm_vendor_have_product($vendor_id) { $args=array( 'post_type' => 'product', 'post_status' => 'publish', 'author' => $vendor_id ); $have_products = get_posts( $args ); return count($have_products); }
Copy the code at the end of functions.php of your activated theme. Also update the plugin(WCFM Marketplace) before adding this code.
Let me know if it is ok.Thank You for your patience.
- August 14, 2019 at 1:40 pm #76600nictParticipant
Hi hi. Thanks for the snippet but when trying it the site fails to load on the frontend. “The site is experiencing technical difficulties.”
- August 14, 2019 at 2:27 pm #76608Sarmistha ChakrabortyMember
Hello,
Can you share us your site and ftp access. So, we can debug the issue in your site.
We presume that you have already updated the plugins.Thank You.
- August 14, 2019 at 3:29 pm #76625nictParticipantThis reply has been marked as private.
- August 14, 2019 at 3:56 pm #76626Sarmistha ChakrabortyMemberThis reply has been marked as private.
- September 18, 2019 at 7:13 am #82246Michael ElliottParticipant
Sorry to jump in but how do I list all the stores? I can”t find the setting that I changed that prevented vendors with no products from being listed and now I need to change that back.
- September 19, 2019 at 6:00 pm #82481WCFM ForumMember
Hi,
Well, you just have to create a page using short code –
[wcfm_stores]
Please check this for details – https://docs.wclovers.com/store-list/
Thank You
- AuthorPosts
- You must be logged in to reply to this topic.