1. Home
  2. Knowledge Base
  3. WooCommerce Better Variations
  4. Troubleshooting Better Variations
  5. Not working for more than 30 variations
  1. Home
  2. Knowledge Base
  3. WooCommerce Better Variations
  4. Not working for more than 30 variations

Not working for more than 30 variations

If you find that Better Variations is not working correctly when you have more than 30 variations for your product, you need to increase the WooCommerce variation threshold.

Please note that the code below increases the limit to 50 – but if you have more than 50 variations, you’ll need to change the value below accordingly.

You can add the following code as a snippet. Find out how best to add code snippets to your site here.

function bv_wc_ajax_variation_threshold( $qty, $product ) {
return 50;
}
add_filter( 'woocommerce_ajax_variation_threshold', 'bv_wc_ajax_variation_threshold', 10, 2 );

Was this article helpful?

Related Articles