you could use the filter woocommerce_gallery_thumbnail_size
, and inside that function, is when you would use the if ( is_product_category(2295) )
something like:
add_filter( 'woocommerce_gallery_thumbnail_size', function( $size ) {
if ( is_product_category(2295) ){
return 'thumbnail';
}
return $size;
} );
you can check the WooCommerce docs here