Support » Plugin: WooCommerce » increasing woocommerce_ajax_variation_threshold breaking page

  • Resolved shreyaskhatri

    (@shreyaskhatri)


    Hi,

    I have same situation as in:
    https://wordpress.org/support/topic/how-to-increase-product-variation-limit-in-woo-commerce/

    Variable attributes not applicable for combination shows up with the message:
    Sorry, no products matched your selection. Please choose a different combination.

    I increased product variation limit, using:

    add_filter( 'woocommerce_ajax_variation_threshold', 'ww_ajax_variation_threshold', 10, 2 );
    
    function ww_ajax_variation_threshold( $default, $product ) {
        return 150;

    However, this doesn’t solve the problem.

    Instead:the page now gives following error:

    
    Warning: count(): Parameter must be an array or an object that implements Countable in public/wp-includes/formatting.php on line 3225

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support RK

    (@riaanknoetze)

    Hi there,

    It looks like the code you shared has an error in it – it’s missing a closing } bracket after the return 150; part 🙂

    The type was while posting the code. The actual code has bracket closed. The issue still persists.

    This is a major issue as if an end user sees all variations – even those which are not available, it is going to lead to very poor experience.

    Kindly help.

    Looks like there have problems in coding or product variations settings

    @wprock : when you say issue with variations settings, where do you want me to look at in the backend?

    Hi,

    Any updates here? It is a critical issue for our project. We are open to someone providing professional paid help on this.

    Plugin Support Rynald0s

    (@rynald0s)

    Automattic Happiness Engineer

    Hi @shreyaskhatri!

    Try the following code:

    add_filter( 'woocommerce_ajax_variation_threshold', 'wc_ninja_ajax_threshold' );
    function wc_ninja_ajax_threshold() {
        return 150;
    }

    Cheers!

    shreyaskhatri

    (@shreyaskhatri)

    @rynald0s thanks for you response.

    However, we found the issue was because the Single Product template was being rendered using Toolset’s Content template.

    Rendering template natively fixed the issue.

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.