How Conditional Attributes Work in Your WooCommerce Store
If you decide to add conditional logic to WooCommerce variations, then you should know that you can’t do it without plugins, because the core WooCommerce attribute system doesn’t support conditional/dependent attributes out of the box.
However, it can be quite useful to display a specific attribute (an attribute swatch or a standard WooCommerce select dropdown) based on the value selected in another attribute.
Right now, I will guide you step by step on how you could start using conditional attributes in your WooCommerce stores with the Conditional Attributes for WooCommerce plugin.
1. Install and activate the plugin
First of all, you need to go ahead and activate the plugin on your website. Please keep in mind that WooCommerce is required as a dependency plugin, but I assume you already have it activated.

Once we have finished with this, probably an obvious step, we can continue to the next one.
2. Configure conditions in attribute settings
It is time to visit a specific attribute settings page, the one which we want to hide or show depending on the value of another attribute.
Let’s go to Products > Attributes, then click the “Edit” link.

Another question is – how to achieve “AND” and “OR” relations in conditions?
If you want a specific attribute to be displayed when at least one of the other attributes has a specific value (the “OR” relation), you can just use the “Show if” option for multiple attributes:

If you want a specific attribute to be displayed when multiple other attributes have specific values at the same time (the “AND” relation), you can just use the “Hide if” option like that:

The point is to simplify the plugin conditional logic build process, as well as the WooCommerce admin UI. Of course, it prevents us from building really complex logic, but since, by design, a WooCommerce variation can have only one value of an attribute, then we probably don’t need anything complex here.
3. Set attribute values for variations which must be conditional
Let’s say that I’m selling wizard hats on my WooCommerce store. If it doesn’t look serious to you, let me assure you – it is just an example, for the sake of simplicity.
So, I have the following attributes for my variable WooCommerce products:
- “Magic level” – “None”, “Basic”, “Advanced”, “Legendary”.
- “Material” – plenty of options here.
- “Spell type” – plenty of options here as well.
Let’s say only hats with the magic level at least “Advanced” may have spells. In other words, we need to completely hide the “Spell type” attribute from our product page unless a specific “Magic level” is selected.
When creating variations, if a specific variation should not have a value of a specific attribute, it will be automatically hidden and receive an empty value of a hidden attribute:

And here you go, our result:
