Magento 2: How to create Product Attributes and add attribute values?
Attributes are used to describe specific characteristics of a product. It provides additional information for the products and is even used as search parameters and as criteria in layered navigation.
Following are the steps to create product attributes in Magento 2 :
#1. On the Admin sidebar, click Stores. Then under Attributes, choose Product.
#2. Click Add New Attribute.
#3. In Admin Properties, add a Default Label to identify the attribute ex. Color
#4. Set Catalog Input Type for Store Owner to the type of input control you want for data entry.
#5. If you want to require the customer to choose an option before the product can be purchased, set Values Required to “Yes.”
#6. For Dropdown and Multiple Select input types, do as following:
- Click Add Option under Manage Options.
- Enter the first attribute value. If you have only one store view, you can enter only the Admin value and it will be used for the storefront as well. For multiple store views, Add one value for admin and other values for each storeview.
- Click Add Option and repeat the previous step for each option.
- Select Is Default to set an option as Default.
Describe the Advanced Properties (if needed)
#7.Enter a unique Attribute Code in lowercase characters, and without spaces or more than 30 symbols.
#8.Specify other details for attribute like Scope, set it as Unique Value or not, run data validity test by setting Input Validation for Store Owner (not applicable for input types Dropdown, Multiple Options checkbox).
#9.Enter Field title from Manage Titles from left side panel.
#10.In the panel on the left, choose Storefront Properties. Set appropriate Storefront properties.
#11.Click Save Attribute.