• Resolved danieldavies2203

    (@danieldavies2203)


    The original Issue

    Originally I was tasked with creating a website which featured a product with lots of variations. Its a memorial plaque which comes in different shapes and sizes, now once I had set everything up i realised that if you were to select the “shape” as “oval” instead of filtering out all the other options that aren’t available for the oval plaque it still showed every available option for every plaque which is just incorrect.

    The 2nd issue
    To fix the first issue I came across this code:

    function gt_wc_ajax_variation_threshold( $qty, $product ) {
    return 500;
    }

    add_filter( ‘woocommerce_ajax_variation_threshold’, ‘gt_wc_ajax_variation_threshold’, 10, 2 );

    Which completely fixed my issue however now the shop portion of my site runs unbelievably slow, it sometimes can take up to 25 seconds to load. So how do i fix my original issue with out slowing my shop down so much?

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Add this to your functions PHP. It’s what i use, and it’s slightly different than yours, and i have no slow downs from using it.

    /**
    * Increase Product Variation Quantity Thresholds
    */

    function ww_ajax_variation_threshold( $default, $product ) {
    return 50; // increase this number if needed
    }
    add_filter( ‘woocommerce_ajax_variation_threshold’, ‘ww_ajax_variation_threshold’, 10, 2 );

    • This reply was modified 4 years, 6 months ago by usat009.
    Thread Starter danieldavies2203

    (@danieldavies2203)

    Cheers for sending that, unfortunately however it doesn’t seem to work at all on my site

    Thread Starter danieldavies2203

    (@danieldavies2203)

    Hopefully this bumps my post, I need a response from a plugin author to fix this.

    Plugin Support Damianne P (a11n)

    (@drwpcom)

    Hi @danieldavies2203. There is an article here that outlines many of the options that you can use to troubleshoot a slow site with lots of variations.

    I could write a new response but I’ve also found this excellent response in the forums that explains the issues and approaches to address it even better than I could.

    I also suggest making sure that your plugins are up to date along with WooCommerce.

    I hope that helps!

    Plugin Support Damianne P (a11n)

    (@drwpcom)

    Hi @danieldavies2203. We haven’t heard back from you so I’m going to go ahead and mark this thread as resolved. If you still need help with this issue or have any other questions about the WooCommerce plugin, please start a new thread.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘too many variations is breaking my site, and the fix I found slows it down’ is closed to new replies.