1. Documentation
  2. Frontend Snippets

Change Limit on Number of Variations for Dynamic Variable Product Dropdowns

By default, if a Variable product has fewer than 30 variations, the dropdowns for selecting variations on the frontend will be dynamic. For example, with a T-shirt that has “Size” and “Color” attributes, after the customer selects a Size, the Color dropdown will be updated via AJAX to only display options that are available with the chosen Size.

However, if there are more than 30 variations, the dropdowns will be static and will display all attributes. Following the example above, if the T-shirt has more than 30 variations, the Color dropdown will continue showing all of the color options even if they are not available for the selected Size. Instead, after they select an unavailable combination, they will see the message “Sorry, no products matched your selection. Please choose a different combination.”

This is done to improve performance on the site. For large numbers of variations, if it has to calculate the available combinations after each selection, it can slow things down quite a bit.

However, this limit can be changed from 30 to another number if desired using the woocommerce_ajax_variation_threshold filter:

WooCommerce - the most customizable eCommerce platform for building your online business.

  • 30 day money back guarantee
  • Support teams across the world
  • Safe & Secure online payment