POSTED IN
  • MAGENTO
  • TRAINING

Magento 2 Guide: Attributes & Atrribute Sets

by: Tim Richardson

on: 19th June, 2018

CALL US

01952 897 444

Here we’re going to look at an important, but sometimes overlooked part of Magento – Attributes.

You are able to create custom attributes and use these improve the information you show for a product and offer more website navigation options, helping to improve user experience, but before we get into that….

What are attributes?

Attributes are the fields that make up a product, the name, price, SKU, description and so on. These attributes are arranged into attribute sets, which are then used to create the template for a product.

These are used to determine what data is stored about a product.

How can we use them

We’ve already mentioned that these are essential for the makeup of products. They can also be used to define additional qualities you want products to have, for example:

If you sell digital cameras and t-shirts, the common attributes such as name, a price, SKU, description and so on will be needed for both of them. They will also have attributes, that are unique to each product, t-shirts will have size and colour, digital cameras will have storage capacity and megapixels.

These attributes will not be needed across both products, so you create your own attribute sets for these products, one for t-shirts where colour and size can be defined, one for digital cameras where storage capacity and megapixels can be set.

These attributes can then be used in a number of ways, including:

  • Defining essential fields for a type of product.
  • Show more detailed information about a product.
  • Used for creating configurable products.
  • Category filtered navigation.

magento-2-filtered-navigation

How to create attributes

So now we’re going to take a look at how you create a product attribute for a t-shirt that comes in different colours – red, black, green, white. Then we’ll see how to create a new attribute set and addour newly created attribute to it.

Product attribute

  1. Stores > Attribute > Product and click ‘Add new attribute’ button
  2. Assign the label colours for your attribute
  3. Choose the input type dropdown
  4. Define the options as – red, black, green, white
  5. Under advanced, change ‘Add to Column Options’ and ‘Use in Filter Options’ to yes.
  6. Go to storefront properties tab
  7. Change ‘Use in Layered Navigation’ to filterable with results.
  8. ‘Use in Search Results Layered Navigation’ to yes.
  9. Finish by clicking ‘Save attribute’ button

Head over to Stores > Attribute > Product.

magento-2-stores-product-attributes

Here, click the add new attribute button and you’ll be taken to this screen.

magento-2-creating-new-product-attribute

The Default label is the identifier for the product attribute, because we’re using this for colours, so we’ll be calling this – colour. Change the catalog input type to dropdown, and underneath, a place where you can define your options will appear.

defining-product-attribute-values

After creating all your options, expand the advanced options section below and ensure that ‘Add to Column Options’ and ‘Use in Filter Options’ are changed to yes.

column-and-filter-options-to-yes

Now head to the storefront properties tab (on the left) and change ‘Use in Layered Navigation’ to filterable with results, this will then let these options be used to filter down products in a category. Click save and we’re done, now to create our attribute set.

filterable

Attribute set

  1. Stores > Attribute > Attribute sets and click ‘Add attribute set’ button
  2. Add the name t-shirts and click save
  3. In the column ‘Unassigned Attributes’ drag your colour attribute to the ‘Product details’
  4. Click save

Stores > Attribute > Attribute sets and click ‘Add attribute set’ button.

magento-2-stores-attribute-sets

Here we’ll be asked to name our attribute set, which we’ll name t-shirts, as that will be the basis for all our t-shirt products. We’ll leave the base it on the Default product attribute set.

attribute-set-name

Now you’ll end up with three columns – first one will be the name you’ve given to the attribute set, second one will be all the attributes your current set has, the third will be all the other attributes which aren’t in there.

attributes-in-attribute-set

What we want to do is find our ‘colour’ product attribute we created earlier and then drag it across into the product details tab. Once we’ve done this, click save and we’re done.

Industry news, tips and general updates.

Sign up to our newsletter, and get our content first.

We will never spam you. You can unsubscribe with one click.

READ MORE

You might also like…

LATEST ADVICE & GUIDES  VIEW ALL

OUR DAILY ACTIVITY   FOLLOW