0

嗨,我只是想问一下,以防有人已经通过了大型 Magento 数据库。

我正在尝试导出数据库中所有产品的列表。

名称 价格 SKU URL 库存水平

通常。

我可以手动浏览这些表格,但只是看看是否有人已经有基本表格的列表。谢谢!

4

1 回答 1

1

干得好:

select name, sku, url_path, qty as stock_level
from catalog_product_flat_1 c1
inner join cataloginventory_stock_status c2 on c1.entity_id = c2.product_id
;

不要忘记调整 'catalog_product_flat_1' 中的 store_id 以使其与您想要的商店相匹配...

编辑:基础图像的图像路径应添加到最后一列:

select name, sku, url_path, qty as stock_level ,c3.value as base_image
from catalog_product_flat_1 c1
inner join cataloginventory_stock_status c2 on c1.entity_id = c2.product_id
left outer join catalog_product_entity_varchar c3 ON c3.entity_id = c1.entity_id AND c3.attribute_id = (select attribute_id from eav_attribute where attribute_code = 'image' and entity_type_id = 4 and store_id IN (0,1))
;

不要忘记调整 'catalog_product_flat_1' 和 IN() 条件(但保留 0)中的 store_id 以使其与您想要的商店匹配...

于 2013-09-04T07:00:04.440 回答