如何在Magento 1.7.0.2中使用MySQL查询更新产品的重量和制造国?
答案 0 :(得分:1)
对于重量,您可以使用此查询:
UPDATE
catalog_product_entity_decimal AS ped
JOIN
eav_attribute AS ea
ON
ea.entity_type_id = 10
AND ea.attribute_code = 'weight'
AND ped.attribute_id = ea.attribute_id
SET
ped.value = {your new value}
WHERE
ped.entity_id = {the product id to update}
如果您想更新制造商所在国家/地区
UPDATE
catalog_product_entity_varchar AS pev
JOIN
eav_attribute AS ea ON ea.entity_type_id = 10
AND ea.attribute_code = 'country_of_manufacture'
AND pev.attribute_id = ea.attribute_id
SET
pev.value = '{new country_id}'
WHERE
pev.entity_id = {the product id to update}
可以在此表“directory_country”中找到可以使用的国家/地区列表,使用country_id进行更新
如果您启用了目录产品平面索引,请不要忘记在更新值
后重新编制索引