1. Home
  2. Knowledge Base
  3. WooCommerce Lead Time
  4. Troubleshooting

The lead time doesn't show for products with more than 30 variations

If you have a variable product which has more than 30 variations, then you may not see the individual variation lead time. This is because if a product has 30+ variations, then WooCommerce uses AJAX to load a variation after you select it.

You can increase the threshold so that WooCommerce allows more variations on the first page load. This enables the lead time to show up correctly.

To do this, add the snippet below to your child theme's functions.php file:

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

We have chosen a value of 50, but you may need to increase this depending on the number of purchasable variations that your product has.

You can also use the $product variable to restrict this change only to a specific product. We recommend doing this where possible because not using AJAX can affect performance/page load times if there is a large number of variations.

We've partnered with Codeable to provide our customers with expert help if required.

Related Articles

If searching the knowledge base hasn't answered your question, please contact support.