Created
March 28, 2017 17:40
-
-
Save w33zy/0077e8d9c256ad28c6ab9bab498228f0 to your computer and use it in GitHub Desktop.
This product is currently out of stock and unavailable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Obviously this was frustrating, but after a little investigation, the fact that they were variations was the key to fixing the problem. | |
Typically WooCommerce allows 60 product variations in total when using ajax to update the variations on the product page, and in most cases the error message is due to the product exceeding this. Fortunately, there’s a relatively simple fix. | |
Add the following code to your functions.php file and you should be seeing your products back in stock in no time at all. | |
// Increase WooCommerce Variation Limit | |
function custom_wc_ajax_variation_threshold( $qty, $product ) { | |
return 100; | |
} | |
add_filter( 'woocommerce_ajax_variation_threshold', 'custom_wc_ajax_variation_threshold', 100, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment