Title: WooCommerce error
Last modified: April 4, 2020

---

# WooCommerce error

 *  Resolved [oringeverything](https://wordpress.org/support/users/oringeverything/)
 * (@oringeverything)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/woocommerce-error-24/)
 * Firstly, I hope everyone is OK and dealing with various states of lock-down. 
   I’m in the UK and in the 2nd week of staying at home. To help stave off the boredom
   I’m trying to build a simple website at o-ring-everything.com.
 * My issues are 2-fold:
 * 1. I inputted the first product, which has 100 variations (FX airguns). It took
   ages and it doesn’t work. When selecting a variation which exists (**see 2.) 
   eg. Biathlon, All Models, Full Kit, All Calibres it returns “Sorry, this product
   is unavailable. Please choose a different combination.”. I tested this with many
   available variations which are in stock and have prices, but it still returns
   the same error.
 * Just to make sure I wasn’t doing anything wrong I added another product, albeit
   with fewer variations, (Gamo) and this works fine.
 * I have seen many threads with code to fix this but none of these “fixes” seem
   to work.
 * 2. The other issue is all the attribute combinations are available to select,
   even though I have not created a variation for it. With issue 1. fixed i will
   still have a problem with customers being able to choose a variation which is
   not for sale, which will be confusing.
 * In eBay only available options are clickable (and visible) which makes the selection
   process easier.
 * I don’t think I’m trying to do anything too complicated, but any help much appreciated.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fwoocommerce-error-24%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [linux4me2](https://wordpress.org/support/users/linux4me2/)
 * (@linux4me2)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/woocommerce-error-24/#post-12628274)
 * Ordinarily, WooCommerce uses an AJAX call to set the available variations when
   you select a variation on which subsequent ones are dependent. For example, when
   you select the Model on your sample page, WooCommerce sends an AJAX call to the
   server to populate the Sub-model with the correct options. However, if you exceed
   the default 30 variations, WooCommerce doesn’t use AJAX, and you end up with 
   options that don’t exist in the drop-down boxes, and your customers see the confusing“
   Sorry, this product is unavailable. Please choose a different combination.”
 * The fix for that issue is to increase the default number of variations that are
   allowed to generate an AJAX call. To do that, figure out what your maximum number
   of variations will be, and add the following code snippet to your [child theme’s](https://developer.wordpress.org/themes/advanced-topics/child-themes/)
   functions.php:
 *     ```
       add_filter( 'woocommerce_ajax_variation_threshold', 'wc_ajax_variation_threshold' );
       	function wc_ajax_variation_threshold() {
       	    return 150;
       	}
       ```
   
 * Change the “150” in the snippet to something higher than your maximum number 
   of variations.
 * Keep in mind that WooCommerce added the default of 30 to reduce the load on your
   server. If your server is underpowered and the threshold is set too high, you
   can end up with problems.
 * Give that a try and see if it fixes both issue #1 and issue #2.
 *  Thread Starter [oringeverything](https://wordpress.org/support/users/oringeverything/)
 * (@oringeverything)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/woocommerce-error-24/#post-12630366)
 * Hello [@linux4me2](https://wordpress.org/support/users/linux4me2/)
 * I am certain I tried this before.
    Edited the file just now and it’s working 
   like a dream – Many thanks for your help.
 * Regards, Matt
 *  [linux4me2](https://wordpress.org/support/users/linux4me2/)
 * (@linux4me2)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/woocommerce-error-24/#post-12630847)
 * Hi [@oringeverything](https://wordpress.org/support/users/oringeverything/)
 * You’re welcome! I’m glad you got it working.
 *  [con](https://wordpress.org/support/users/conschneider/)
 * (@conschneider)
 * Engineer
 * [6 years, 1 month ago](https://wordpress.org/support/topic/woocommerce-error-24/#post-12640741)
 * Thanks everyone.
    Closing.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘WooCommerce error’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

## Tags

 * [sorry](https://wordpress.org/support/topic-tag/sorry/)

 * 4 replies
 * 3 participants
 * Last reply from: [con](https://wordpress.org/support/users/conschneider/)
 * Last activity: [6 years, 1 month ago](https://wordpress.org/support/topic/woocommerce-error-24/#post-12640741)
 * Status: resolved