Magento找到了孤儿产品

时间:2012-03-05 13:49:54

标签: php magento

是否有一种简单的方法可以提取/查看既未与类别或可配置产品相​​关联的所有产品的列表?

1 个答案:

答案 0 :(得分:2)

我相信这个SQL查询会对你有所帮助。

 select
    type_id,sku
 from catalog_product_entity a
 left join catalog_category_product cp on cp.`product_id` = a.entity_id
 left join catalog_product_relation cpr on cpr.child_id = a.entity_id
 where 
       cp.product_id is null 
   and cpr.parent_id is null
   and a.type_id != 'configurable' -- per ben below