Home Forums WoodMart support forum Variable product combinations displaying when they are not available

Variable product combinations displaying when they are not available

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #235659

    ToriTori38
    Participant

    Hi there,

    We have a variable product where people can select product “size” and “colour”. Not all product sizes come in all colours. However on the frontend, when you select a size, it shows all the colour variations (not just the colours available in that size). This is not standard WooCommerce behaiour. Usually WooCommerce only shows the colours available (it hides variables which are not possible combinations).

    It’s very annoying from a user perspective as you have no idea which product variations are posisble, without trying each one.

    Is there a way to hide the product variations which are not available (like is usually standard with WooCommerce)? Many thanks

    #235695

    Hello,

    Please test this on the default Attribute filter and you will see that when you select a size, the result will show all the products having this size, regardless of the colors. Our theme does not influence the Woocommerce functionality. WoodMart widgets just expand a bit the default filter attribute.

    Best Regards

    #236128

    ToriTori38
    Participant

    Hi there. This was nothing to do with where I setup the attributes. WooCommerce by default hides unavailable variations in products. However, this is limited to only 20 product variations β€” that was the problem!

    Now I found that out, I have added a snippet to fix it. You can close this ticket.

    #236191

    Ok. If you have any questions please feel free to contact us.

    Best Regards

    #242806

    FrancoMarini
    Participant

    Ho ToriTori. You are a genius. How do you fin it?
    Can you explain like β€œto a chili”? Im not a programmer and i don’t know how ti do it.

    Please please 😀

    #242810

    ToriTori38
    Participant

    It’s your lucky day πŸ™‚ This snippet will save you a lot of time and headaches and will solve your problem:

    function custom_wc_ajax_variation_threshold( $qty, $product )
    {
        return 50;
    }
    add_filter( 'woocommerce_ajax_variation_threshold', 'custom_wc_ajax_variation_threshold', 10, 2 );
    #242900

    FrancoMarini
    Participant

    Hi Man!!!
    thanks a lot.. a very very lot!!! πŸ™‚
    Itry but i think is working with first and second variant.
    If I have 4 variant I have to change the snippet?

    this is my page test
    https://www.conkrea.shop/v1/?post_type=product&p=9069

    #242913

    ToriTori38
    Participant

    Glad to help but I am afraid I cannot offer you any support past that! I’m not a developer myself. Best of luck πŸ™‚

    #242915

    FrancoMarini
    Participant

    ok thanks a lot! πŸ™‚

Viewing 9 posts - 1 through 9 (of 9 total)