Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seb86/a4800e380273716cad7c12deed2b70d7 to your computer and use it in GitHub Desktop.
Save seb86/a4800e380273716cad7c12deed2b70d7 to your computer and use it in GitHub Desktop.
Increase the number of variations loaded in the WooCommerce front end for dynamic filtering of available variations in the drop down lists.
<?php //only copy this line if needed
/**
* Function filters the threshold for the amount of variables to load in the front end.
*
* @see https://woocommerce.wordpress.com/2015/07/13/improving-the-variations-interface-in-2-4/
* @param int $threshold Default of 30
* @return int 100 The new threshold.
*/
function lets_increase_the_variation_threshold( $threshold ) {
return 100;
}
add_filter( 'woocommerce_ajax_variation_threshold', 'lets_increase_the_variation_threshold' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment