Is there a way to hide a vendor shop, or make it inactive, while the vendor is setting up and adding products? I'd like for shoppers not to see empty stores.
Hiding Vendor Shops
Closed
Comments
Hi Michelle,
Thanks for reaching out,
To achieve this, I'd recommend adding this code snippet to your theme's functions.php file or any code snippets plugin:
add_filter('marketking_vendor_is_inactive', function($inactive, $vendor_id){
if (marketking()->is_vendor($vendor_id) && (int) count_user_posts($vendor_id, 'product', true) === 0) {
return true;
}
return $inactive;
}, 10, 2);This hides any store with no published products. Once they publish their first product, their store will appear automatically.
Let me know if that can solve it for you,
Kind Regards,
Stefan