Raise the Variation Limit for Instant Price Updates
Increases the number of variations WooCommerce loads with the page (30 by default), so large variable products update price and stock instantly and hide unavailable combinations.
Opens WPIDE on
Code
add_filter( 'woocommerce_ajax_variation_threshold', function () {
return 100; // Maximum variations loaded with the page.
} );
Notes
Very large values make product pages heavier. 100 to 150 suits most stores.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.