dejonge
dejonge

Reputation: 21

Woocommerce optional product attributes

The custom attributes of a variable product are required. How can I make some of those attributes optional?

I've searched in woocommerce for the optional option, but there is none. So I'm wondering if there is an option to add this trough the Wordpress functions.php

What I actually want is an option to select if the attribute is optional or required.

Upvotes: 2

Views: 2939

Answers (1)

carrdarch
carrdarch

Reputation: 53

I've just had the same issue where I have a list of dropdown attributes for a product, where only some of these attributes need to be selected. I understand what LoicTheAztec is saying and must assume this is how WooCommerce think as well which is why I don't think there's an elegant answer in code. However, the simplest answers are the best.

What I did is just add a --NONE-- attribute value at the start of the list. Set this as the default value and Robert's your mother's brother.

Upvotes: 2

Related Questions