- WooCommerce Cookbook
- Patrick Rauland
- 405字
- 2021-07-23 19:35:07
Adding global product attributes
In addition to using categories and tags similar to WordPress posts, there's one extra way that you can categorize your products, and that is by using product attributes. Product attributes are things such as color, size, style, and so on. A simple product could have multiple attributes. A small red and blue t-shirt could have the following attributes: red, blue, and small.
Setting up global product attributes will make creating variable products easier down the road.
How to do it…
Make sure you already have a simple product in your store and proceed with the following steps:
- From the WordPress admin, go to Products | Attributes.
- Under the Add New Attribute heading, you'll see settings to create attributes. The only mandatory field is Name.
- Enter a name for the attribute and click on the Add Attribute button.
- Now click on the icon on the far right in the Attribute table. When you hover over the button, you should see Configure terms.
- Enter a name for an attribute term. If your attribute is Color, then the attribute terms will be specific colors such as red, black, blue, white, and so on. Repeat this step for each attribute term. At the end, you should have a list of attribute terms.
We've created a product attribute and some attribute terms. Now we can add them to our products.
- From the WordPress admin, go to the Product page and click on Edit for any one of your products.
- Under the Product Data panel, click on the Attributes tab.
- You should see a drop-down with a list of attributes. Select your attribute and then click on the Add button.
- Start typing in the attributes that apply to this product. As you type, a suggestion tool will pop up that helps you select an attribute.
- Now save your product by clicking on the Update button.
There's more...
If you check the Visible on the product page checkbox under the attribute you selected on the Attributes tab in the Product Data panel, these attributes will show up on the product page in an Additional Information tab.

In Chapter 3, Changing the Product Organization, there's a recipe (Adding filtered navigation with the Layered Nav widget) that details how to filter your products with the Layered Nav widget. By adding attributes to your products, you make it easier for users to navigate your store and search for your products.
- Web程序設計及應用
- Mastering Unity Shaders and Effects
- 匯編語言程序設計(第3版)
- The Complete Coding Interview Guide in Java
- C++從入門到精通(第5版)
- 打開Go語言之門:入門、實戰與進階
- Troubleshooting Citrix XenApp?
- Python網絡爬蟲技術與應用
- Visual FoxPro 6.0程序設計
- Android Game Programming by Example
- 超好玩的Scratch 3.5少兒編程
- Microsoft HoloLens By Example
- 3D Printing Designs:Octopus Pencil Holder
- 用Python動手學統計學
- MongoDB Cookbook