Day: November 14, 2016

WooCommerce hide unavailable veriations from dorpdown

If there are greater than 20 variations in the product, it will use ajax to find matches and won’t hide combinations (because doing so would mean loading all variations before display).

Use is code in your functions.php

function custom_wc_ajax_variation_threshold( $qty, $product ) {
	return 10;
}

add_filter( 'woocommerce_ajax_variation_threshold', 'custom_wc_ajax_variation_threshold', 10, 2 );

 

Change the return value as per your number of combination.

Advertisements