I want to ask, how to get a list of all products SKU and there categories For example:
SKU | category | image | price | msrp |
---|---|---|---|---|
Value 1 | cat1/cat2/cat2 | /123.jpg | 123 | 145 |
with Mysql query
edit: What I have tried so far:
SELECT e.entity_id, e.sku, a.value FROM catalog_product_super_link b
LEFT JOIN catalog_product_entity AS e ON e.entity_id = b.product_id
LEFT JOIN catalog_category_product AS cp ON cp.product_id = b.product_id
LEFT JOIN catalog_category_entity_varchar AS a ON a.entity_id = cp.category_id
WHERE b.parent_id=368538
GROUP BY b.product_id
SELECT e.entity_id, e.sku, a.value FROM catalog_product_super_link b LEFT JOIN catalog_product_entity AS e ON e.entity_id = b.product_id LEFT JOIN catalog_category_product AS cp ON cp.product_id = b.product_id LEFT JOIN catalog_category_entity_varchar AS a ON a.entity_id = cp.category_id WHERE b.parent_id=368538 group by b.product_id
but i get null in my category field