• Resolved jberg1

    (@jberg1)


    Hello,
    I was running WC V2.0.13 on a site and it used to make changes to attribute choices depending on what was chosen in another attribute dropdown. For example. Choose color black, then the size choices would change based on what variations were available. If a size wasn’t available in black it didn’t offer the choice.

    Now I have upgraded to 2.6.14 (yea that was too long), but now when I choose the color black, I get all the size choices even if they aren’t available. If I select a size that isn’t available in that size, then I get a message “Sorry, no products matched your selection. Please choose a different combination.”

    Is there a way to make it work like it used to and just not show the attribute choice for unavailable variations?

    Thanks for any help.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Please post the url to a page where this happens.

    Thread Starter jberg1

    (@jberg1)

    So I can only show you the current site with the old version of WC where it works the way I want. The updated site is still in development, but basically it doesn’t change the choices. It just spits out the message where the price usually shows.

    https://goo.gl/AHiwNq
    Choose a color, then you notice how the accent color choices change based on that selection.

    Thanks for your help.

    • This reply was modified 8 years, 1 month ago by jberg1.

    I’m seeing 77 variations.

    The way variations over 20 in number are handled was changed in WC v2.4. See “Front end changes” here:
    https://woocommerce.wordpress.com/2015/07/13/improving-the-variations-interface-in-2-4/
    The user can make any selection, then Ajax is used to fetch the relevant variation data and the message is given if it happens to be one those permutations that’s not available.

    You can increase the threshold from 20 using this code snippet:

    <?php
    add_filter( 'woocommerce_ajax_variation_threshold', 'custom_threshold', 10 );
    function custom_threshold( ) {
        return 100;
    }
    

    This should restore previous behaviour.

    As the threshold goes higher, the amount of data sent with the page will increase, so page load time will increase. Experimentation and a judgement call will be needed.

    The code goes in functions.php in your child theme.

    Thread Starter jberg1

    (@jberg1)

    Ah Lorro,
    You Are King!!

    Worked like a charm. Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Product Attribute Choices Change Based on other Attribute Choice’ is closed to new replies.