Loubradou Posted January 12, 2015 Share Posted January 12, 2015 Bonjour, je souhaiterais ajouter une liste contenant toutes les catégories de ma boutique dans mon template product-list.tpl mais je ne trouve pas comment m'y prendre. Pourriez-vous m'aider ? Cordialement, Antoine. Link to comment Share on other sites More sharing options...
Alexandre Carette Posted January 12, 2015 Share Posted January 12, 2015 faudrait faire un module avec une fonction qui recupère toute les cat dans le Category.php il peut y avoir ce genre de chose, mais je ne sais pas si ca recupere tout... à tester... public static function getCategoriesWithoutParent() { $cache_id = 'Category::getCategoriesWithoutParent_'.(int)Context::getContext()->language->id; if (!Cache::isStored($cache_id)) { $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' SELECT DISTINCT c.* FROM `'._DB_PREFIX_.'category` c LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category` AND cl.`id_lang` = '.(int)Context::getContext()->language->id.') WHERE `level_depth` = 1'); Cache::store($cache_id, $result); } return Cache::retrieve($cache_id); } Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now