Understanding Attributes
Attributes in woocommerce are used to categorize or add additional information to a product. They can be used for this in two ways:
- To add additional information to the product, this can be done for both simple and variable products. For variable products these are common across all variations.
- For variable products , they can also be used to differentiate variations of a product.
An Example
Lets look at a t-shirt as a possible product you are selling. These t-shirts are made of cotton or polyester, available in the colors, red, green and black, and are available in sizes, small, medium, large and x-large. So are attributes might be
- Material: Cotton, Polyester, …
- Color: Black, Green, Red
- Size: Small, Medium, Large, X-Large
In the sections on Adding Attributes and Editing the Product we will get into the details of adding a product, but for now we are looking at this conceptually.
So we add three attributes, Material, Color and Size and for each attribute we add the appropriate values. At this point we are adding the three attributes so they are available to any product. This means they can be used by any product but do not have to be. Of the three attributes, Material is used to add addition information, Color and Size are used to differentiate variations of a product. Lets look at how these might be used for three different models of t-shirts
V-Neck T-Shirt
Made from cotton, available in all colors and sizes but black is not available in small. So we add three attributes
- Material set to Cotton
- Color with all the values and set to be used for variations
- Size with all the values and set to be used for variations
Color and size together give us 12 (number of colors times number of sizes) possible variations. When we add the actual variations we will only add 11 since black/small is not available. When a custom views the product they will see two drop downs, one for size and one for color. If a custom should pick the size first and select small, the color drop down will no longer list black. If they first select black as the color, size will no longer list small.
Round Neck T-Shirt
Made from polyester, available in red and black and all sizes. So we add three attributes
- Material set to Polyester
- Color with Red and Black and set to be used for variations
- Size with all the values and set to be used for variations
In this case we have 8 possible variations (2 colors times 4 sizes). In this case the color drop down only shows Red and Black.
Patterned T-Shirt
Made from polyester, available all sizes. So we add two attributes.
- Material set to Polyester
- Size with all the values and set to be used for variations
In this case we have 4 possible variations, one for each size. The user will only see a size drop down since we have not added color as a attribute.
Important Lessons
- Just because an attribute has say 12 possible values, a particular product does not need to use all the values. The Round Neck T-Shirt for example only uses the colors red and black.
- Even if a product uses all possible values of an attribute or attributes, it does not need to define a variation for every combination of values. The V-Neck T-Shirt for example does not define a variation for small/black.
- Not all products need to use all attributes, even for similar products. For example, the Pattered T-Shirt does not use color as an attribute.
In the context of this site
One of the attributes already defined is Wire Size. It includes both imperial and metric values, “up to ” values for products like the Cable Cutters, and “Lug ONLY” for at least one product. So why all these “different” values for one attribute.
- When an attribute serves the same purpose, we want customers to see the same name.
- In the case of wire size, some products are only imperial or metric while others have both units as a choice. And for some, like “Cable Cutters”, the choice is still related to wire size, but in this case not specific size.
- And in the case of “Lug Only”, it handles the case where wire size applies but not for all variations, This will be used for C. Sherman Johnson Inner Forestay Lever when adding the attributes.