- 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.
- The Complete Rust Programming Reference Guide
- Learning ROS for Robotics Programming(Second Edition)
- 數字媒體應用教程
- Python數據分析入門與實戰
- Beginning Java Data Structures and Algorithms
- OpenCV實例精解
- Instant Zepto.js
- INSTANT Sencha Touch
- TradeStation交易應用實踐:量化方法構建贏家策略(原書第2版)
- Visual Foxpro 9.0數據庫程序設計教程
- Django 3.0入門與實踐
- 趣學數據結構
- Java EE 程序設計
- Swift編程實戰:iOS應用開發實例及完整解決方案
- 區塊鏈原理、設計與應用