Query για να παίρνουμε ιεραρχικά τις κατηγορίες στο Prestashop
![](https://www.digispot.gr/wp-content/uploads/2017/11/prestablog1.jpeg)
SELECT c.id_parent, c.id_category, cl.name as name,level_depth FROM mm_category c LEFT JOIN mm_category_lang cl ON (c.id_category = cl.id_category AND id_lang = '2') LEFT JOIN mm_category_group cg ON (cg.`id_category` = c.id_category) LEFT JOIN `mm_category_shop` cs ON (c.`id_category` = cs.`id_category` ) WHERE c.id_category <> '1' GROUP BY c.id_category ORDER BY level_depth ASC,c.id_category ASC, cs.position ASC,c.`id_parent` ASC