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

Disable plugin if no additional variation images are added

Paul Lucas

Hi,

Is it possible to disable the gallery (plugin) if no additional variation images are added to a product.

I have some products that only have one variation image and for these products I would rather use the default gallery.

Thanks

Golam Kibria

Hi Paul,

Unfortunately, this feature is not currently available.

Please add a feature request here: https://storepress.fider.io/

Thank You

Paul Lucas

Thanks for the reply.

Instead, is it possible to disable the plugin for a particular product category/s?

I tried using the following code that you posted on another thread, but unfortunately it results on an error 500 on product pages:

add_filter( 'disable_woo_variation_gallery', function( $default ){
global $product;
if ( function_exists( 'is_product' ) && is_product() ) {
$terms_post = get_the_terms( $product->get_id() , 'product_cat' );
$target_cat_ids = [18]; //Insert the category id’s inside the target. For Example: [14,45]
if( in_array( $terms_post[0]->term_id, $target_cat_ids ) ){
return true;
}
return $default;
}
}, 20, 1);

Any idea why this doesn’t work?

Thanks

Golam Kibria

Hi Paul,

Can you give me a reference of where you have found the snippet?

It appears to be a modified version of a snippet that we shared the the Swatches plugin.

Our plugin requires the default gallery for its functionality.

So, the default gallery is already there.

Thank You

Golam Kibria

Hi Paul,

Unfortunately, the code you have found is a sample code.

Sorry that we cannot help you with this.

Please add a feature request here: https://storepress.fider.io/

Thank You