How are product attributes and attribute options stored in Magento database?

前端 未结 5 830
隐瞒了意图╮
隐瞒了意图╮ 2020-12-22 19:01

I am trying to figure out how the linkage between attribute and attribute options, and product and attributes are made in Magento. Is there any reference to how this is work

5条回答
  •  北荒
    北荒 (楼主)
    2020-12-22 19:42

    SELECT pei.value 
    FROM `catalog_product_entity_int` pei 
    JOIN `eav_attribute` ea 
    ON pei.attribute_id = ea .attribute_id 
    WHERE pei.entity_id = {your product_id} 
    AND ea.attribute_code = '{your attribute_code}'
    

    Note that there are a number of different tables like catalog_product_entity_int depending on the type of the attribute, so one of those other ones could be appropriate.

提交回复
热议问题