Chapter 7. Categories

We will cover the following concepts in this chapter:

  • Categories
  • Hierarchy
  • Top navigation

Categories

Magento provides a way of organizing your catalog into different categories and subcategories. You can organize your catalog internally in the admin panel and offer to the customers a clear way of browsing your products on the Storefront.

You can manage the categories in your store by going to the PRODUCTS | InventoryCategories section in the admin panel:

Categories

Once that section is loaded in the admin panel, you will see the category tree on the left, and the form to add and the edit categories on the right:

Categories

On top of the category tree, you will see two buttons:

  • Add Root Category: You can add root categories. This is useful to set up multiple store views, for example, a store for clothing and another store for electronics and computers. These stores will be separated store views, each one of them with a specific catalog contained in different root categories. An example of two root categories can be seen in the following screenshot:

    Categories

  • Add Subcategory: You can add a subcategory for the current category. In the preceding screenshot, the Alternative Store root category was selected, so if we click on Add Subcategory, then the subcategory will be created, as you can see in the following screenshot:

    Categories

We added a root category and a subcategory, but we haven't reviewed the form to create them. We will create a new category, and we will go through the process step by step:

  1. Click on the Default Category in the category tree to select it:

    Categories

  2. Click on Add Subcategory on the top-left corner of the screen.
  3. Add the following information to the top section of the form:
    • Enable Category: Yes
    • Include in Menu: Yes
    • Category Name: Sample Category

    These fields are self-explanatory. The Include in Menu field allows you to set whether the category should be included in the main navigation menu in the Storefront or not:

    Categories

  4. Set the following information for the Content section:
    • Category Image: Add a banner image for the category, as shown in the following screenshot:

      Categories

    • Description: Add a sample description for the category
    • Add CMS Block: You can add a static block to be displayed in the category
  5. Set the following section in Display Settings:

    Categories

    In this section, you can set:

    • Display Mode: You can choose between showing only products, only the selected static block, or both. For this category, we will select Products only.
    • Anchor: If you select Yes, then the category will have a layered navigation filter on the left sidebar. The layered navigation is the block that lets you filter the category by attribute, for example, by color or size. We will choose Yes for this category.
  6. Next, we will find the Search Engine Optimization section:

    Categories

    The following settings are available in this section:

    • URL Key: You can set the specific URL key for the category. We will leave this empty for this category, and Magento will create the URL key based on the category title.
    • Meta Title: You can set the title meta tag for search engine optimization.
    • Meta Keywords: You can set the keywords meta tag for search engine optimization.
    • Meta Description: You can set the description meta tag for search engine optimization.

    We will leave the fields for Meta Title, Meta Keywords, and Meta Description empty, and Magento will assign the meta tags based on the category title.

  7. You can select the products that will be associated with this category in the Products in Category section:

    Categories

    As per the preceding screenshot, select all the products that we created in the previous chapter.

  8. The next section is Design. Just like the products, you can set a specific design for the categories as well:

    Categories

    We will go through each of the fields, but we will keep the default values for all of them:

    • Use Parent Category Settings: If you click on this checkbox, the category will inherit the design configuration from the parent category
    • Theme: You can choose a specific theme for the category
    • Layout: You can set a specific layout for the category:
      • Empty
      • 1 column
      • 2 columns with left bar
      • 2 columns with right bar
      • 3 columns
    • Layout Update XML: Add a custom XML configuration for the category layout, such as a custom style sheet
    • Apply Design to Products: If you click on this checkbox, the associated products will inherit the design configuration from this category
  9. The section at the end of the form is Schedule Design Update. Here, you can specify a range of dates for the design update from the previous section. We will leave this empty as well for this category.
  10. Click on Save to add the new category.

    When the category is saved, you will see the message confirmation and the category as a child of Default Category:

    Categories

    If you go to the Storefront, you will see the new category in the main navigation menu:

    Categories

    If you go to that category, you will see the configuration and the products that we set in the category form before:

    Categories

    Categories

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.59.218.147