Last active
October 9, 2021 09:13
-
-
Save mohsinoffline/f06c66259e667d6b16bb to your computer and use it in GitHub Desktop.
WooCommerce: Increase variation threshold to prevent AJAX
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 | |
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 ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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