• Resolved kvnvdh

    (@kvnvdh)


    Hi,

    I’m trying to set up a product with many variations. There are 2 variation-options,
    SIZE and COLOR.

    However, not every size has every color, or not every color has every size available.
    I added the variations that are available, and it works like I want it to.
    Meaning, when I select a SIZE, the second list should only show the available COLORS, and the other way around.

    However, once it goes over a certain amount of variations, this functionality breaks, and it just shows ALL the options always.

    I have seen something about the treshold being 30 variations, and it can be set higher with some code. But how exactly do I do this?

    Can someone please tell me exactly what code I should add, and where?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello,

    I have seen something about the treshold being 30 variations, and it can be set higher with some code. But how exactly do I do this?

    You can apply the code below to increase the variation threshold. You can use a plugin like?Code Snippets?to easily apply the code to your site.

    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 2 years, 9 months ago by MayKato.

    We’ve not heard back from you in a while, so I’m marking this thread as resolved. If you have further questions, please feel free to open a new topic.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘conditional variations available in second dropdwon’ is closed to new replies.