Group WooCommerce product attributes
In WooCommerce Attribute Swatches v1.1.0 the ability to group product attributes was added.
Let's say you have a Color attribute. The color choices vary in style; gloss / matte / patterned. By default they would all show one after the other:
But using the new Groups setting, you can split them up to make it much more user-friendly:
Let's look at how this can be achieved.
How to create WooCommerce product attribute groups
It's important to note that you can only create groups for global attributes; this is any attribute created under Products > Attributes.
- Navigate to Products > Attributes.
- Click Edit on an attribute (color, for this example).
Scroll down to the Groups field.
Start typing in the name of your first group, and then select it from the dropdown.
Continue this process for the other groups.
Navigate back to Products > Attributes.
Click Configure Terms.
Click to Edit a term.
Scroll down to the Group field.
Select a group from the dropdown.
Repeat steps 8 to 11 for the other attribute terms.
That's it! Now when you view the swatches on the frontend they'll be grouped. Any that aren't added to a group will display right after the main attribute label.