0

I was trying to find some fields because i want to obtain all the products and then, make a query but i was not able to do that(they dont appear in the database diagram for Magento 1.9):

This is the diagram:

diagram https://anna.voelkl.at/uploads/magento/ce1922.png

I only found the fields "SKU" and "min_sale_qty". What happened to the others?

Do these fields : code_brand, code_business_unit, code_line, code_group, code_business even exist or they were created by someone?

image

Anyway, i am using MYSQL connected to the MAGENTO database.

0

products in Magento are EAV models, which leads to most attributes not having an own column in the catalog_product_entity table.

If you are searching for a specific attribute value of a specific product you first have to go into the eav_attribute table, search the attribute you are looking for (by attribute_code for example) and get the id and type of the attribute.

For example values of the type text are saved in the catalog_product_entity_text table. To get the value you can filter it by product id (entity_id) and attribute_id. (There can still be multiple values for each store. store_id=0 is the default value).

The easiest way to get the values would be using the product repository (as it handles all needed db joins in the background for you).

If you must use sql to get the data you have to join the tables corresponding to your needs

2
  • Thank you for replying!. Can i access this table eav_attribute directly using a query? (select * from + table name). If so, after executing that query i have to look for this fields: (sku, code_brand, code_business_unit, code_line, code_group, code_business, min_sale_qty), get their id and type of the attribute. Am i right? How can i find those that are not type text?. Anyway, how can get the product repository? – programming_amazing Jan 27 '19 at 13:34
  • Dude, if you have a little time off, can check my question: magento.stackexchange.com/questions/260205/… You are the one who knows! – programming_amazing Feb 2 '19 at 14:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.