Magento数据库表 - 存储EAN的位置

时间:2017-12-04 09:37:27

标签: magento

我正在开发一个Magento项目并完成对ebay流程的导入我可能需要对EAN编号进行批量更新。

我正在审查数据库和表格 - 我还没有找到或看到有关此“EAN”字段存储位置的任何指示。

我可以在magento网站的编辑面板中的“常规”下看到它出现在个别产品上

3 个答案:

答案 0 :(得分:0)

在查看单个产品时,它显示在“常规”标签下,表示EAN是产品属性。<​​/ p>

根据EAN产品属性的后端类型,值存储在catalog_product_entity_*表中。如果您不知道类型,则需要检查eav_attribute表的内容以获取EAN记录。

可以在此处找到解释Magento数据库结构的好文章:https://fishpig.co.uk/magento/tutorials/eav-database-structure/

答案 1 :(得分:0)

了解EAV。

获取产品ID的资料

SELECT entity_id, value FROM catalog_product_entity_varchar 
WHERE attribute_id IN ( SELECT attribute_id FROM eav_attribute WHERE attribute_code = 'ean');

将ean写入magento

INSERT INTO catalog_product_entity_varchar
(value, entity_id, entity_type_id, attribute_id, store_id)
VALUES ('".$value."', ".$productId.", 4, ".$attributeId.", ".$storeId.")
ON DUPLICATE KEY UPDATE value = '".$value."'

其中$ attributeId是表eav_attribute

中“ean”属性的id

答案 2 :(得分:0)

我不认为Magento带有EAN代码。您必须为此创建一个属性。