Jump to content

how to show module in category


Tamade

Recommended Posts

or in module:

$cat = array('Kitchens', 'Bedrooms', 'Lounges');

if (in_array(Context::getContext()->category->name, $cat)) {

/* your function */

}

Link to comment
Share on other sites

 

I can't get him to show it. I have this set (it works but if I make a new category I have to modify here too)

    catalog/listing/category.tpl

{if ($category.id >=6 && $category.id<=8) || $category.id ==23 || $category.id ==39 || $category.id ==40 || ($category.id >=10 && $category.id<=19 ) || $category.id ==44 || ($category.id >=50 && $category.id<=59) }
    {hook h='displayTopCategory1'}
  {/if}

Link to comment
Share on other sites

And why do you write it to a tpl template?
If you have a module, write it to the php module.
Hook displayTopCategory1 is your own?
After all, it is easy to display a list of categories in the configuration of your module, check the categories and add a condition for displaying your own tpl file as a hook.

Sample module:

obrazek.thumb.png.cbc87095a882cf52df710386f6afe753.png

 

Edited by Guest (see edit history)
Link to comment
Share on other sites

Well, this is the easiest way.
Clear, possibility in the category block and search, etc.
Yes, good programming knowledge is needed.

The module should have approx. 250 lines of code, approx. two hours of work, including testing.

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