哪个数据库表保存了 Magento 中产品的主图像的信息?
我看了
- catalog_product_entity_media_gallery
- 和catalog_product_entity_varchar
但看不到一张图像是如何标记为主(基本)图像的。
Magento 版本:1.8.1.0
最佳答案
此信息存储在catalog_product_entity_varchar
中。
在从数据库获取此信息之前,您必须知道基本图像属性的 attribute_id
,您可以通过以下方式获取此 id:
SELECT `attribute_id` FROM eav_attribute where `attribute_code` ='image' AND entity_type_id = 4;
对我来说结果是85
,现在如果我们想要获取id为1020的产品的基本图像信息:
SELECT * FROM catalog_product_entity_varchar where `attribute_id`=85 and `entity_id`=1020
希望有帮助。
关于mysql - Magento 中哪个表保存主图像的信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26983379/