Jump to content

Ajouter catégories dans product-list.tpl


Recommended Posts

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...