fbpx
Want To Add Extra Images Per Product Variation For Free? Download Now

Disable swatches on archive / shop page for specific products

Dave Verzijl

I would like to disable “Show swatches on archive / shop page” for specific products because they have too many options. How do I do that?

 

screencapture-gunderwear-nl-webshop-ondergoed-product-cat-abonnement-box-2021-12-04-15_22_50.png

Hakik Zaman

Hi Dave,

Unfortunately, the feature is not currently available.

​But it’s a great idea. I’ll discuss this feature with my team.

In the meantime, please send the feature request here: https://storepress.fider.io/
and ask your other to upvote it.

But you are familiar with the code you can try the below instructions-

Make a category to not display swatches and assign the category for those specific products. Then you can use the below snippet inside Code Snippet Plugin-
add_filter('wvs_pro_show_archive_variation_template', function($default){
global $post;
$terms = get_the_terms( $post->ID, 'product_cat' );
foreach ($terms as $term) {
$product_cat_id = $term->term_id;
break;
}
if( is_shop() && $product_cat_id == 45 ){

//here 45 is the category id
return false;
}
return $default;
});

I hope it will help. Hope to hear from you soon!

Cheers!

Dave Verzijl

Thanks a lot for your reply. I conform that the code works perfectly.

I also submitted a reply on the feature request site – I saw that someone else already asked the exact same feature.

Hakik Zaman

Hi Dave,

I conform that the code works perfectly.

Glad to know it works from your side.

I saw that someone else already asked the exact same feature.

Our research team is investigating the feature and will pass it to the development team.

We really get excited & honored when you use our plugin on your site.

If you found my support helpful, my humble request to you to write your beautiful thought here: https://wordpress.org/support/plugin/woo-variation-swatches/reviews/?filter=5

Your beautiful thought keeps us inspired.

Thank You