• Resolved birthma

    (@birthma)


    Hi there, I have an issue with the base woocommerce variable products and conditional logic. For some context, we have around 450 variables under 1 product.

    Ideally, we want one thing to lead to another e.g. the user selects material = Acrylic, then they get only the thickness’ we offer, and then you get the colour we offer, and finally you get the sizes available based on the above 3 choices.

    Currently, users are able to select choices that we don’t offer and aren’t included in the backend.

    Is there a way to achieve the above conditional logic? Thanks!

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

Viewing 6 replies - 1 through 6 (of 6 total)
  • It is probably related to the high number of variations.

    WooCommerce by default will hide unavailable product variations regardless if you use Variation Swatches plugin or without (the limit seems to have been 30 in 2020, as per this article: https://superstorefinder.net/support/knowledgebase/fix-woocommerce-not-hiding-disabled-unavailable-variations/).

    You could use:

    function custom_woocommerce_ajax_variation_threshold( $qty, $product ) { return 1000; // Set 1000 to another number to load faster } add_filter( 'woocommerce_ajax_variation_threshold', 'custom_woocommerce_ajax_variation_threshold', 10, 2 );

    in your child theme functions.php, as suggested in the article.

    I tested it with 300 variations and it works as intended.

    Thread Starter birthma

    (@birthma)

    Thanks for that, worked!

    • This reply was modified 1 year, 8 months ago by birthma.

    Glad to hear you made it work!

    Thread Starter birthma

    (@birthma)

    Maybe this is unavoidable but I’ve noticed ever since I’ve done the above those pages on the website are very slow. Is there any way to fix this?

    I’m sorry but I think that’s what the limit of woocommerce was trying to avoid. I haven’t noticed too much slowdown but I don’t have your number of variations, it may also depend on the server though.

    Thread Starter birthma

    (@birthma)

    No problem, thanks again.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Woocommerce Products + Conditional Logic’ is closed to new replies.