2014-12-03 63 views

回答

1

你可以只尝试将条目添加到catalog_category_product表..:

INSERT IGNORE INTO catalog_category_product (category_id, product_id) 
SELECT ccp.category_id, cpr.child_id FROM catalog_product_entity cpe 
JOIN catalog_product_relation cpr ON cpr.parent_id = cpe.entity_id 
JOIN catalog_category_product ccp ON cpe.entity_id = ccp.product_id 
WHERE cpe.type_id = 'grouped' 
ORDER BY cpe.entity_id 
; 

下面的SQL将增加它们与任何分组产品所有类别的该分组的产品分配相关联的所有简单的产品。我刚才写道,并没有测试它,所以一定要在启动PRODUCTION db之前测试它;-)

相关问题