Jump to content

Displaying content anywhere in the page from a hook in module.php file


Recommended Posts

Hi,

 

I want to dispaly some content anywhere in the prestashop page from a hook in module.php file.

let say on home page in the main content area:

 

created a div "<div id='testing'></div>" then in the rightColumn hook i fetched some data using "Configuration::get('PS_DATA')".

 

No from rightColumn hook, how can i display that data into my created div or how can i send data from right column to a specific tpl file?

 

please reply asap.

 

regards.

Link to comment
Share on other sites

Hi,

If it's in the right column, you cannot send it to the homepage hook, simply because the hook of the right column is executed afterwards. You should hook to header, and assign variables there, so that you can use them everywhere in the page :)

Link to comment
Share on other sites

  • 2 years later...

In your prestashop's php file, in the hook function, you can just use include. However, it really depends on how that custom php file is. I suggest trying to incorporate it better into the system, especially because this is not going to be possible (with external files) in late 1.7 versions

Link to comment
Share on other sites

×
×
  • Create New...