Jump to content

Adding a category list to the header


Recommended Posts

Hi,

 

My Client wants to have a dropdown based on a certain category to be shown in the header section, next to the logo.

I tihnk the easiest would be to replicate "block category" module and install it in the header section (with hardcoded parent number) ? Am I right ?

 

How can I install the category block to be shown in the header section please?

Is there any easiest way like just putting a loop to the header.tpl which returns always the same level of the same category without hardcore coding ?

 

 

So lets say we have the logo and then next to it a simple dropdown "our picks" based on the category

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

Hi !

The category module seems to fit your needs.

To hook your module in the right position in your template, you'll have to use (or creat) a hook near your logo.

Actually you can hook the category module on hookLeftColumn/hookRightColumn and hookFooter.

To add a hook go to the module php fuile named blockcategories.php and add this line :

public function hookRightColumn($params)
	{
		return $this->hookLeftColumn($params);
	}

But then you have to be careful with updates cause this hack will be overrided so I advise you to make a copy of the module changing his names and vars and then add it to you prestashop so that you don't have problems with updates...

Good luck !

Link to comment
Share on other sites

Great help !! Thank you !

 

So as far I understand I need to :

1) replicate the category module to have 2 similar modules in total as separate modules.

2) use one of them as the regular category module

3) use hacked version of the second, replicated one to act as a dropdown list of one, the same category tree ( I could hardcode the category id in there to display "our picks" dropdown only )

 

 

Is there a way of putting just a snippet of smarty code to the header.tpl just to loop a list of category_id = 5 ?

Link to comment
Share on other sites

You're welcome !

1,2,3 that's it !

I just took a look to tpl and php files, there's no way of choosing one specific category...
Maybe hacking the tpl or change the getTree function in the php.
Maybe using CSS hiding the ones you don't want...

If someone else has featured it it's right the time to help ^^

Regards.

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