I have a variable product in WordPress + WooCommerce and it has 2 attributes: color and size.
I’d like that when I select one of these 2 attributes, the unavailable variations with the second attribute will be automatically hidden (or unselectable) from the attribute select menu.
Is it possible? How can I achieve that?
I haven’t found any plugin that can do that. I’m trying to figure out what part of code to edit, but it’s quite a difficult task…
I ran into your (old) question as i had it too. This is a working solution.
Change ‘return 10’ to a number higher than your total amount of variations.
Add it to your function.php file: