• Resolved cheyenne711

    (@cheyenne711)


    After adding this code to show only allowable variations, I get a countable php error message.

    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 to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Shameem R. a11n

    (@shameemreza)

    Hi @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. 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.

    I wish I could help more, but hopefully, this gets you going in the right direction to get the job done.

    Thread Starter cheyenne711

    (@cheyenne711)

    Thank you, I have reached out to the Woo Community Slack

    Hi @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.

    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.