Product attributes: The importance, setting and management in Magento 2

Header-Image@2x

Magento and Magento 2 have always provided the level of sophistication for product attributes. Before diving into the creation of products, you need to explore a very important and powerful feature of Magento 2: product attributes. Read on to become familiar with product attributes in Magento 2.

Product Attributes Overview

Magento 2 uses attributes to manage the information associated with products. An attribute is a property of a product. For example, the product color, the size, or the description. Some attributes are built into the system by default. And others can be created to address specific needs. You can add, edit, or remove product attributes in Magento 2 to customize your products.

Attribute sets

Attribute set represents a list of attributes that are related to a specific product family. After creating the attributes, we organize and group them into different attribute sets.

Each product has a unique DNA, thus you need different dedicated attribute sets specific to each product family. For example, shoes and cameras require different specific types of information . Shoes could have different colors, brands, and sizes. While a camera could have item weight, optical zoom, megapixels, screen size, iso range etc.,

Why are Magento 2 product attributes so important and powerful?

Product attributes are the building blocks of your Magento 2 product catalog. They not only describe the characteristics of a product, they are also used as search parameters, as criteria for layered navigation, product comparison, and price rules.

Let’s go through a few practical use case of product attributes and attribute sets that essentially help you manage a diverse array of product data.

Showing additional information on product page

You can add a tabbed section with more information that catches your customers’ eye on the product page. The attributes listed above are for demo purpose. However you can flexibly add any relevant product attributes into the More Information tab that help your customers get a better understanding of your products.

Using in the Layered Navigation

Attributes can also be used to create the layered navigation that appears in the sidebar on your category pages.

For example, when using Magento 2 theme Claue by ArrowHiTech, the initial results include all products in the category. Section of layered navigation, the list can be filtered further by choosing a specific Color, Screen Size or price, etc.

product attributes

Filterable attributes for layered navigation

Using in Quick search and Advanced search

Magento 2 supports a quick search box in the upper-right corner. And a link to Advanced Search in the footer where shoppers can enter attributes as search criteria. With the Quick search box, the search text can be the full or partial product name, or any other word or phrase that describes the product.

product attributes

Quick search box on Magento 2 Claue theme

Advanced Search helps shoppers find products in your catalog based on multiple attributes entered into a form. You can specify an attribute to be displayed in the Advanced Search form by setting the frontend properties of the attribute to “Include in Advanced Search”. As a best practice, you should include only the fields that your shoppers are most likely to use to find a product. For example: product name, SKU, description, price, because having too many will slow down the search.

Expolre Instant Search Extension for Magento 2 by ArrowHiTech:

is

Lightning-speed of Instant Search search suggestions for products, categories, CMS page and even Blog content.

Adding attributes for product comparisons

Beside the roles as search criteria, filterable layered navigation, you can use attributes for comparison purposes.

Magento 2 lets your shoppers quickly compare the features of two or more products side by side. You can certainly add or remove attributes that you don’t want to include in the comparison report.

product attributes

Add to Compare on Magento 2 theme – Claue

Using with price rules

Another powerful use case of product attributes is with price rules for promotion purposes.

In Magento 2, product attributes are used as a set of specific conditions for catalog and shopping cart price rules. Price rules can be set in advance that trigger actions when the required conditions are met, such as:

  • Sending your best customers a coupon for a discount on a specific product
  • Offering free shipping for purchases over a certain amount
  • Scheduling a promotion for a period of time.

When navigating to your Admin | Marketing | (Promotions) Catalog Price Rules, then clicking on Add New Rule button, you should see Condition section similar to this screenshot:

g

Attributes are used as a variety of conditions in price rules

For an attribute to appear in the list above, you must set the Use for Promo Rule Conditions to “Yes” (This setting is available under Storefront Properties tab of such attribute’s configuration panel).

Using for sorting in Product Listing

Product sorting is another area where attributes come in handy. If viewed from the Product Listing page, the sorting option will have default values: Position, Product Name, and Price. You can customize these sorting option your way. For the attribute you want to use, set the Used in Product Listing to ‘Yes’.

Capture

Sorting products by attributes on Product Listing page

Steps to Create Product Attributes in Magento 2:

Implement each step as shown below:

Enter the basic properties

  1. Log in to Admin Panel
  2. Navigate to Stores > Attributes > Product
  3. Click “Add New Attribute1_Product Attributes Grid
    1. Under Attributes Properties,
      1. Enter a Default Label to identify the attribute.
      2. In the “Catalog Input Type for Store Owner” field, set type in input control to be used for data entry.
        1. If you had selected drop-down or multiple select input types:
          1. Under “Manage Options“, click “Add Options
          2. Enter the first value that you want to appear on the list. You can enter one value for the Admin, and a translation of the value for each store view. If you have only one store view, you can enter only the Admin value and it will be used for the storefront as well.
          3. Repeat the previous step for each option to be included in the list.
          4. For the option to be used as the default value, select “Is Default

2. Set “Yes” to “Values Required” if you want to require the customer to choose an option before the product can be purchased.

2_attribute properties

Enter the advanced properties

  1. Set a unique attribute code. It should be lowercase characters without any spaces.
  2. Select the scope from Store View, Website, or Global to indicate where in the store the attribute s allowed to be used.
  3. Enable the field “Unique Value” to avoid duplicate values.
  4. With “Input Validation for Store Owner” field, you can validate the data entered in the text field.
  5. Set the “Add to Column Option” to “YES” to add this attribute to the list of column options
  6. Set the “Use in Filter Option” to “YES” to add the attribute to the list of filter options.3_Advanced Attribute Properties

Enter the Field Label

  1. Go to “Manage Labels” under Attribute Information
  2. Expand “Manage Titles

Enter a Title to be used as a label for the field. In the case of multi-language support, enter the title for each view.4_Manage Titles

Enter the Store Front properties

  1. Go to “Store Front Properties” under Attribute Information
  2. Enable the “Use in Search” field for the attribute to be available for search.
  3. Enable “Comparable on Storefront” field to include it in product comparison.
  4. For catalog input field to be drop down, multiple select or price:
    1. Set “Use in Layered Navigation” to “YES” to use the attribute as a filter in layered navigation.
    2. Set “Use in Search Results Layered Navigation” to “Yes” to use the attribute in layered navigation on search results pages.
    3. Set the relative position of the attribute in the layered navigation block in “Position“.
  5. Enable Use for Promo Rule Conditions” field to use the attribute in price rules.
  6. Enable “Allow HTML Tags on Storefront” field to allow the text to be formatted with HTML and use WYSIWYG editor
  7. Enable the “Visible on Catalog Pages on Storefront” field to make the attribute visible in catalog page listing.
  8. If Product Listing is supported with your theme, the attribute can be appeared and used as sort parameter by enabling “Used in Product Listing‘ and “Used for Sorting in Product Listing5_Storefront properties

 Save

  1. Click the “Save Attribute” button to save the configuration.

You can see the custom_attribute created and listed in the Product Attributes grid:

6_New attribute created - Products Attribute Grid

Now that you have an overview about the essential roles of Magento 2 product attributes. The process is easy but you can always ask doubts, if any, in the Comments section below.

402 Total Views 6 Views Today