Jump to content

How to hook header and footer to a prestashop custom page


Recommended Posts

HEY Guys,

 

 

I have a question for you which is probably asked before. Surprisingly i havent found any topic that explains what i want , or probably i am not looking at the right place. So after searching for weeks i finally decided to post this topic so that you guys will help me and guide me in the right direction.

 

I want to create a custom page in prestashop. Its not a cms page its a normal page in the root directory of prestashop. Now i have the content that will go in the content part of the page. I just need to hook my default header and footer into this page. Also how do i get the seo for this page working? Can someone please guide me in the right direction.

 

 

What i did was copy the header code(header.tpl) and then the content code(one that i want to show on the page between header and footer) and finally the footer code (footer.tpl) to a php file and it ran properly. But the hooks do not work, like the login, search bar, etc.

 

Can someone help me regarding this?

 

Thanking you guys in Advance.

Link to comment
Share on other sites

I believe, all you need to do is create your custom php page in the root directory, use the "include" function to load the config file, and reference the controller file that corresponds with your new page functions.

 

The controller you referenced in your page will load the header/footer and other content via php. Take a look at the other controllers in the controller directory for examples. The controller will also reference your template file in your theme directory. That template/theme will also reference your header and footer.

 

They all work together. And you may also need a custom class file too (class directory), depending on what you are trying to do with your page.

 

If anyone sees an error in my explanation, please correct me. :)

Link to comment
Share on other sites

×
×
  • Create New...