How to Create Attributes For Layered Navigation

How to update layered navigation in Magento.

By Suada Cane

Layered Navigation is a type of tool that can help customers filter the products they may be looking for.

In Magento, it mostly relies on a product’s attribute. There are two things we have to do to make sure Layered Navigation is working — letting Magento know which categories it should be activated for and creating attributes to filter by.

Let’s get the first step out of the way and check that our category is set for Layered Navigation.

To do this, navigate to Catalog > Manage Categories in the Magento admin panel.

From here, select the category that you’re going to have Layered Navigation on. Navigate to the tab that says “Display Settings”

Check to make sure “is Anchor” is set to Yes.

Save the category.

Next, we’ll create the attribute that’s going to be used for filtering your Layered Navigation.

To do this, navigate to Catalog > Attributes > Manage Attributes

Click “Add New Attribute”.

Fill out the Attribute Code.  Note that this name won’t be seen by customers. It’s really more for your own organization, so follow naming conventions as you see fit.

Under Attribute Properties, be sure to set the “Scope” to “Global”.  

Then, set the “Catalog Input Type for Store Owner”.  This dictates how options will be set for this attribute.

For it to work in Layered Navigation, it MUST be either Multiple Select, Dropdown, or Price.

In the next section, “Frontend Properties”, select “Filterable (with results)” in “Use In Layered Navigation”.

The difference between the two is that “with results” will only display products that fit the criteria.  “no results” means all links will displayed regardless of what is selected for that attribute.

In the left hand side, you’ll see we were on “Properties”. Click down to “Manage Label/Options”.

Fill in the information for “Manage Titles”.  In this example, you’ll see that I have “Example” under Admin and “Attribute” under Default Store View.

Example is what you would see in the admin panel when editting a product.  A customer will see “Attribute”.  This is great for organization.  If you leave the field under the store views blank, those values will default to whatever you put in under admin.

In the next section, we’ll click “Add Option” since this is a drop down attribute.

Naming is the same rule as in “Manage Titles”.  
“Position” and “Is Default” will show. Position is the number in which you want those options to be ordered. You enter a number in this field and the options will be ordered numerically.

“Is Default” is the default option you want to have displayed. This is for convenience.

When you’re done adding options, click “Save Attribute”

Now we have to add the attribute to an attribute set.  Navigate to Catalog > Attributes > Manage Attribute Sets

Select the attribute set to apply this attribute to.

You’ll see our “example_attribute” on the right side. Click and drag your attribute to a folder on the left side.

I’ve placed it under “General” at the very top. When you move these attributes into a space, the order you place them in is reflected in the product, which you’ll see later.

You can also add a new folder by clicking “Add New” and add your attributes there. Another organization convenience.

After you’ve finished, hit “Save Attribute Set”

Now, when you go to edit your products or see a new product, you’ll see your attribute.

Remember how we put the example attribute at the very top? It’s reflected in the product edit.

And you’ve created a filter for Layered Navigation!

Remember, you won’t be able to filter through these attributes unless the products are in the category that has “is Anchor” set to “Yes”.