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

marco incerti

Hi, I have a problem with the swatches.
I would like the attributes to become grayed out if the store’s products or sizes are out of stock. In most products this happens but in some, due to being out of stock, they do not darken.
Can you help me? I attach two examples to explain myself better.

This is the result that i would like to show:

Senza titolo1.png

But in some product it doesn’t work, like in this case even if all the size are out of stock:

Senza titolo.png

Golam Kibria

Hi Marco,

Please add the following snippet to your child theme’s functions.php file:

add_filter( 'woo_variation_swatches_global_ajax_variation_threshold_max', 'woo_variation_swatches_global_ajax_variation_threshold_max_edit', 10, 2 );
function woo_variation_swatches_global_ajax_variation_threshold_max_edit( $size, $product ){
return 700;
}

Let me know if this helps.

Thank You