Saltar al contenido

PRESTASHOP: Consulta SQL para sacar listado de productos con las categorías a las que pertenece

22/02/2017
SELECT l.id_product, l.name, p.reference, GROUP_CONCAT(c.id_category) categorias
FROM  ps_product AS p
LEFT JOIN  ps_product_lang AS l ON p.id_product = l.id_product
LEFT JOIN ps_category_product AS c ON p.id_product = c.id_product
WHERE l.id_lang = '1'
AND p.active = '1'
GROUP BY c.id_product;

 

Vía https://samuelrocha.es/presashop-sql-productos-categorias-pertenece/