Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
WooCommerce: Increase variation threshold to prevent AJAX
function ww_ajax_variation_threshold( $default, $product ) {
return 50; // increase this number if needed
add_filter( 'woocommerce_ajax_variation_threshold', 'ww_ajax_variation_threshold', 10, 2 );
Copy link

giannischiout commented Oct 24, 2020

Hi, how do i properly ad this to my childs theme? Where do i place it? Will it need any changes in the future, and why would that be? Thank you very much!

Copy link

sandeepb633 commented Feb 18, 2021

where i have to place the above code

Copy link

imhugos commented Jun 17, 2021

where i have to place the above code

Hi, I hope it's not too late... You can place this code on functions.php of your theme / child theme.

Copy link

tarik8844 commented Oct 9, 2021

i want to set this kind of variations
select 4 variations for free from 10
select 1 variation from 4
if seleceted new variation price for each selection is 2$ for example
this is helpful for composition of salad for example
thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment