Forked from jessepearson/increase-variation-threshold.php
Created
January 27, 2021 12:23
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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