fbpx
Want To Add Extra Images Per Product Variation? Download This Free Plugin

Disabled attribute style to more than 100 variations not working

Hi support,

Is there a limit to “disabled attribute style” function to more than 100 variations? Out of stock variations are hiden ou bluered fine until 99 variations, from 100  variations or more it does not works.

Is there a limit to pro version? Is it possible to increase this limit?

Best regards,
Robson

Hakik Zaman

Hi Robson,

Thanks for reaching out to us.

Generally, the WooCommerce default threshold value is 30.

After that, WooCommerce uses the Ajax mechanism to get variation data, and unavailable options will not be removed (from the dropdown) when you have more than 30 variations. Unavailable variations will be selectable, and it will display a message – “Out Of Stock“.

Using our Pro plugin, the threshold will be increased to 100 by default. Moreover, our Pro plugin displays swatches on the archive/shop page. Therefore, it is not recommended to increase the value more than 100. Otherwise, you may experience a slow site issue.

By the way, here is a snippet to increase the threshold:

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; //Increase the threshold value here
}

Hope to hear from you soon.

Thank You

Hi Hakik,

Thanks for the heads up and the code snippet, it worked fine.

Best regards,

Robson