When you go shopping, there are many features your customers will consider how to fit with their needs such as the size of a shirt or the color of a bag, etc. And if you are running a Magento 2 store, creating product attributes is completively easy for you. First of all, let’s start with the definition of the product attribute. You can follow create product attribute programmactically post if you want to create product attributes in any special case.
The attributes which are the block of a product in a catalog which enable customers to point the existing characteristics of your product. You are allowed to create as many attrinbutes as you need for a product in Magento 2 configuration. Each attribute will approve only one type of input that you will assign in the settings. Beside giving additional information of the product, the attributes are also used as search parameters and criteria to filter in layered navigation M2, product comparison reports, and promotions.
The product attributes can be created from the Stores menu or the Product Detail page where you are working with the product.
Follow all these steps with detailed guides to create a Product Attribute:
Product > Inventory > Catalog, click on
Editlink on the Product Detail page, then click on
If you want to use a new attribute for the product, just click the
New Attribute and move to the next steps.
You can also go to the New Attribute page by doing the following: On the Admin Panel,
Store > Attributes > Product, the click the
Add New Attribute
The Basic Properties is required for an product attribute.
Default Labelto describe the attribute.
Catalog Input Type for Store Owner, choose the type of the input from a list.
Add Optionand do the above guides again for the next options.
Is Defaultcheckbox if you want to use it as the default.
Value Requiredto ask customers to select the options before purchasing.
The Advanced Properties is optional to add the new product attribute.
Attribute Codethat is less than 30 characters and excluded spaces.
Scopeincludes Store View, Website, and Global.You will choose one of three places in your store system where the appearance of attribute is approved.
Unique Valueif you not want to share it with other products.
Input Validation for Store Owner. The following input types are valided:
Titlethat is shown for the field label. In case of multiple languages supported on your store, insert the translation of the title for each view.
Use in Searchto be ready for searching the attribute.
Comparable on Storefrontfield.
Use in Layered Navigation.
Use in Search Results Layered Navigation.
Positionof the attribute in the layered navigation block.
Use for Promo Rule Conditionsfield to apply the product attribute for the price rules.
Allow HTML Tags to Frontendand the WYSIWYG editor is ready to edit the text all time.
Visible on Catalog Pages on Storefrontfield.
Used in Product Listingand
Used for Sorting in Product Listingfield.
Save Attributeto finish all.
In the settings progress of creating the new product attribute, there are many input types you need to assign directly to the attribute fields such as Text Field, Dropdown, or Yes/No. The input types will specify the type of data that is inserted into the fields, the format of the fields and input control. All attribute fields take a responsibility to give more details about your products and it is required for the customers to complete them before purchasing if needed.
Text Field: The field supports text type with only one line.
Text Area: The text area is the text field with multiple lines in it. It allows a paragraph such as product description. For the text area, the WYSIWYG Editor is available to format with HTML tags, or insert tags directly into the text.
Date: The Date value can be entered directly or selected from the dropdown list or click on the Calendar icon that depend on your purpose.
Yes/No: The field includes 2 options: Yes and No in the dropdown.
Dropdown: Dropdown allows listing all values for the field at the same time and accepts only one value.
Multiple Select: Many values will be accepted at the same time in the field. All values appear in the dropdown.
Price: Price value is set for the price field of the product. You can also use the Price value for Special Price, Tier Price or Cost field. The currency is based on your configuration.
Media Image: The images of the attribute in Media Image field will link to an additional image of the product with Base, Small, and Thumbnail although the thumbnail gallery will not inlucde the media image.
Fixed Product Tax: Give the fixed number for FPT rate
Visual Swatch: The visual swatches can describe the true color, texture, or pattern with a hexadecimal color value, or an image.
Text Swatch: A text swatch is like a button that is used for an attribute value as size.
It comes to the end of the tutorial: How to Create a Product Attribute in Magento 2.