Share This Post

I had a large number of Woocommerce variations for a project and the dropdowns were showing options that were not possible to create a product from. To remove these unwanted options, I need to increase a variation threshold.

This probably is due to the woocommerce_ajax_variation_threshold. If your product contains more variations than the threshold specifies, woocommerce will wait until all variation options have been selected by the user before determining if the selected combination of options is valid(in stock, exists, etc).

Just set the threshold to a higher value. If your product has 30 possible combinations(whether they actually exist or not) set the threshold to something higher than 30, like 1111 for example.

You can use the snippet below in your functions.php file.

/* Increase Woocommerce Variation Threshold */
function wc_ajax_variation_threshold_modify( $threshold, $product ){
$threshold = '1111';
return $threshold;
add_filter( 'woocommerce_ajax_variation_threshold', 'wc_ajax_variation_threshold_modify', 10, 2 );

Full discussion here

Share This Post