Create subcategories

After creating the foundation of the website, we need to set up a catalog structure. Setting up a catalog structure is not difficult but needs to be well thought out.

Some websites have an easy setup using two levels, while others sometimes use five or more subcategories. Always keep in mind user experience: your customer needs to crawl the pages easily. Keep it simple! The following image shows a simple catalog structure:

Create subcategories

Getting ready

To step through this recipe, you will use a Droplet created in Chapter 2, Magento 2 System Tools, at DigitalOcean (https://www.digitalocean.com/). We will be using an NGINX, PHP-FPM, Composer-based setup with Magento 2 preinstalled. No other prerequisites are required.

How to do it...

For the purpose of this recipe, let's assume that we need to set up a catalog including subcategories. The following steps will guide you through this:

  1. First, log in to the backend of Magento 2 and then go to Products | Categories.

    Since we have already created Root Catalogs, we start with using the Root English catalog first.

  2. Click on the Root English catalog on the left and then select the Add Subcategory button above the menu. Now commit the following and repeat all steps again for the other Root Catalogs:

    Name

    Shoes (Schuhe) (Chaussures)

    Is Active

    Yes

    Page Title

    Shoes (Schuhe) (Chaussures)

    Name

    Clothes (Kleider) (Vêtements)

    Is Active

    Yes

    Page Title

    Clothes (Kleider) (Vêtements)

  3. Since we created the first level of our catalog, we can continue with the second level. Now click on the first level, which you need to extend with subcategories, and select the Add Subcategory button. Commit the following and repeat all steps again for the other Root Catalogs:

    Name

    Men (Männer) (Hommes)

    Is Active

    Yes

    Page Title

    Men (Männer) (Hommes)

    Name

    Women (Frau) (Femmes)

    Is Active

    Yes

    Page Title

    Women (Frau) (Femmes)

  4. Congratulations, you just finished configuring subcategories in Magento 2. Now let's open up a browser and surf to the domain names you created earlier: yourdomain.com, yourdomain.de, and yourdomain.fr. Your categories should now look as follows:
    How to do it...

How it works…

Let's recap and find out what we did throughout this recipe. In steps 1 through 4, we created subcategories for the English, German, and French stores. In this recipe, we created a dedicated Root Catalog for every website. This way, every store can be configured using their own tax and shipping rules.

There's more…

In our example, we only submitted Name, Is Active, and Page Title. You may continue to commit the Description, Image, Meta Keywords, and Meta Description fields. By default, the URL key is similar to the Name field; you can change this depending on your SEO needs.

Every category or subcategory has a default page layout defined by the theme. You may need to override this. Go to the Custom Design tab and click the Page Layout drop-down menu. We can choose from the following options: 1 column, 2 columns with left bar, 2 columns with right bar, 3 columns, and Empty layout.

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

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