Latest news

How To Use Flat Catalog In Magento 2? (10 minutes)

No comments

WHAT IS FLAT CATALOG IN MAGENTO 2?

As you might know, there are 2 data models in magento 2, namely EAV Catalog and Flat Catalog.

  • EAV Catalog: On one hand, the EAV Catalog is an entity attribute value database model. Every column data value is stored in their corresponding data type table. Moreover, the EAV Catalog allows us to add as many custom attributes as possible. However, the thing is that since the product attributes are stored in various tables, so as to get the data it will take a lot of time as well as trigger many actions. As the result, it might affect negatively to your store performance.
  • Flat Catalog: The Flat Catalog on the other hand, has to use only one table. More specifically, it will take all product attributes in a multi-column table and be updated automatically based on your cron job.

Advantages of using Flat Catalog: Enhancing the speed of catalog and cart price rules process. In other words, it will contribute to boost your performance.

HOW TO ENABLE FLAT CATALOG IN MAGENTO 2?

  • 1st step: Navigate to the Catalog

Go the Admin Panel, navigate to STORES and choose Configuration (under Settings)

(Admin Panel => STORES => Configuration)

flat catalog magento 2

On the left panel, please tap CATALOG and select Catalog in the dropdown.

use flat catalog in magento 2

  • 2nd step: Enable Flat Catalog

Firstly, you must expand the Storefront section.

Secondly, uncheck the box Use system value  next to the Use Flat Catalog Category and set it to Yes.

Thirdly, you must also set the Use Flat Catalog Product to Yes.

Finally, save the config after you finish.
magento 2 flat catalog

  • 3rd step: Refresh Cache

There will be a message that requests you to refresh the cache.


HOW TO CHECK THE RESULTS ON THE FRONT-END?

There are 2 methods to see the results, one for a single product and the another for multiple products. We will show you both of them.

  • Checking the results for the single product

Go the Admin Panel, navigate to PRODUCTS and choose Catalog (under Inventory)

(Admin Panel => PRODUCTS => Category)

enable flat catalog in magento 2

Choose a product you want to edit (double-click on it or click on Edit button)
set up flat catalog magento 2

Add the tail “_DEMO” to the product name as the following and then save it.

Now, you can access your homepage, search for the product you have edited as well as browse that item through navigation menu to make a comparison.

  • Checking the results for multiple products

Go the Admin Panel, navigate to PRODUCTS and choose Categories (under Inventory)

(Admin Panel => PRODUCTS => Categories)

flat catalog in magento 2

Next, in the category tree on the left, choose any category, then click on the Add Subcategory button. After that, set the category name (e.g.: Test).

set up flat catalog in magento 2

To continue, let’s expand the Products in Category section, and check on the product(s) you want to add to the new category. Finally, save the new category.

Once again, to see the result, you must come back to your homepage and search for the new category in the navigation menu.


We have shown you basic definition of the flat catalog in Magento 2 and more importantly, how to set up and check its results on your storefront. If you have any problems when following this tutorial, be free to ask us by leaving a comment below. See you in the next tutorial!


See More Our Magento “How To” Series:

How To Config RSS Feeds In Magento 2

How To Create And Manage Newsletters In Magento 2

How To Create And Manage Coupon Codes In Magento 2

How To Create New Cart Price Rule In Magento 2

How To Create New Catalog Price Rule In Magento 2

 
1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)

Loading...

April LeeHow To Use Flat Catalog In Magento 2? (10 minutes)

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *