cancel
Showing results for 
Search instead for 
Did you mean: 

Get Several Product Attributes as Columns on "catalog_product_entity"

   Did you know you can see the translated content as per your choice?

Translation is in progress. Please check again after few minutes.

Get Several Product Attributes as Columns on "catalog_product_entity"

I'm trying to make a table that shows a list of products with various product attributes but I'm completely stuck with the way to do it.

 

Expected Table looks like below;

entity_id, sku, price, cost

_______________________

1,abc,20,15

2,def,30,25

3,ghi,10,5

 

Both product attribute values below are stored in the same column on the table  "catalog_product_entity_decimal"

Price: attribute_id = 77

Cost: attribute_id = 81

 

Thus, if I inner join tables, each entity_id has 2 lines for attribute_id 77 and 81

 

Could you please help me get over this?

1 REPLY 1

Re: Get Several Product Attributes as Columns on "catalog_product_entity"

Hi @makoto_matsumot,

You can check flat data of the products after enabling "Flat Catalog".


Table name should be like:
catalog_product_flat_1

catalog_product_flat_2

Numeric values are store id.

To enable flat data, you can use following magento dev docs.
https://docs.magento.com/m2/ce/user_guide/catalog/catalog-flat.html

I hope it will help you!