Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
WooCommerce: Increase variation threshold to prevent AJAX
<?php
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 );
?>
@giannischiout
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!

@sandeepb633
Copy link

sandeepb633 commented Feb 18, 2021

where i have to place the above code

@imhugos
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.

@tarik8844
Copy link

tarik8844 commented Oct 9, 2021

i want to set this kind of variations
product
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