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

Variation Swatch only for Particular Category of Products

Hi,

How can we set up the plugin to work only for a particular Product Category as we don’t want the plugin to to work on all the Products.

Also we have Extendion Measurements as a plugin for certain products in the Wallmural category.

When we switch the Swatches plugin then the Extendion measurement plugin stops working.

Can you please check. e.g this product as you can see Swatches is on but the measurement plugin is not working. When you deactivate the Swatch plugin it starts working

https://www.evershinewalls.com.au/product/aged-globe-map-mural-wallpaper/

Hakik Zaman

Hi La Demeure,

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.

BTW, you can try the below snippet using the Code snippets plugin

add_filter('default_woo_variation_swatches_single_product_dropdown_html', function($default){
   global $post;
   //Add your category id's here. For example: [17,25]
   $cats = [17];
   $terms = get_the_terms( $post->ID, 'product_cat' );
   foreach ($terms as $term) {
      $product_cat_id = $term->term_id;
      break;
   }
   if ( is_product() && in_array($product_cat_id, $cats) ) {
      return true;
   }
   return $default;
}, 10, 1);

Cheers!

Hi Hakik

But how do i fix the issue , its causing me lost of sales as people can’t buy the product as the calculator stopped working