Jump to content

List all categories in category.tpl


Recommended Posts

Hi, I made a custom menu bar in my category.tpl file and i need to assign all categories in a variable which will be enable in my tpl with a foreach.

 

Where can i assign all categories in a smarty var ? Is There already a method who can do that ?

 

(Excuse me for my bad english...)

Link to comment
Share on other sites

may i know how you did that? i think that this will be useful for other merchants with similar question

Yup :)

 

I just assign all categories to a variable with this function : 

 

$categories = Category::getHomeCategories($this->context->cookie->id_lang, false);

 

Here, i put false on my second parameter to take ALL categories, even thoses which are disabled and in my tpl i'm just making them gray in my loop if they are disabled.

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...