Title: Countable Error
Last modified: October 27, 2023

---

# Countable Error

 *  Resolved [cheyenne711](https://wordpress.org/support/users/cheyenne711/)
 * (@cheyenne711)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/countable-error/)
 * After adding this code to show only allowable variations, I get a countable php
   error message.
 *     ```wp-block-code
       function custom_wc_ajax_variation_threshold( $qty, $product ) {
       return 450;
       }
   
       add_filter( 'woocommerce_ajax_variation_threshold', 'custom_wc_ajax_variation_threshold', 10, 2 );
       ```
   
 * I only had the issue on this product as it has over 400 variations possible. 
   When I removed some of the variations the error did not display. Any help would
   be greatly appreciated.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcountable-error%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Support [Shameem – a11n](https://wordpress.org/support/users/shameemreza/)
 * (@shameemreza)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/countable-error/#post-17167289)
 * Hi [@cheyenne711](https://wordpress.org/support/users/cheyenne711/)
 * The function you’ve used is setting the AJAX variation threshold to 450. This
   means that if a product has more than 450 variations, WooCommerce will stop using
   AJAX to load them. Your issue arises when the product has over 400 variations,
   which might be causing the PHP error.
 * To resolve this, you can increase the threshold to a higher number, say 1000,
   to accommodate all your product variations.
 * This should resolve your issue. If you continue to experience problems, we recommend
   asking development questions on the #developers channel of the [WooCommerce Community Slack](https://woocommerce.com/community-slack/).
   Many of our developers hang out there and will be able to offer insights into
   your question.
 * Please note that we can’t provide support for coding or customization as [per our support policy](https://www.woocommerce.com/support-policy/).
 * I wish I could help more, but hopefully, this gets you going in the right direction
   to get the job done.
 *  Thread Starter [cheyenne711](https://wordpress.org/support/users/cheyenne711/)
 * (@cheyenne711)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/countable-error/#post-17168142)
 * Thank you, I have reached out to the Woo Community Slack
 *  [Tamrat A. (woo-hc)](https://wordpress.org/support/users/bisratlearn/)
 * (@bisratlearn)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/countable-error/#post-17174506)
 * Hi [@cheyenne711](https://wordpress.org/support/users/cheyenne711/),
 * > I have reached out to the Woo Community Slack
 * Great to hear that you’ve reached out to the WooCommerce Community Slack! They’re
   a knowledgeable bunch and should be able to provide further assistance.
 * I’ll go ahead and mark this thread as resolved. However, if you ever have more
   questions or issues in the future, don’t hesitate to kick off a [**new topic**](https://wordpress.org/support/theme/storefront/#new-topic-0).
 * Good luck with your work on the variations issue, and have a great day!

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

The topic ‘Countable 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

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

 * 3 replies
 * 3 participants
 * Last reply from: [Tamrat A. (woo-hc)](https://wordpress.org/support/users/bisratlearn/)
 * Last activity: [2 years, 6 months ago](https://wordpress.org/support/topic/countable-error/#post-17174506)
 * Status: resolved