Jump to content
Sign in to follow this  

Modify Hook's output

Recommended Posts

Hi there :)

Hope all is well in the PrestaShop community. I write to request some help, in the area of Hooks and theming. I will try to be brief and concise (english isn't my main lang.).

I have been asked by an employer, to, based on a psd design, create a prestashop installation. I've been hacking arround, looking at the code, and reading online articles on line for quite a while, and am now able to modify the theme a bit through the header.tpl, and footer.tpl files.

The main problem I am facing, is that the needs of this customer are very precise, and the output of {$HOOK_LEFT_COLUMN} doesn't fit them... I've accidentally found that the following code seems to define it, but I can't find where module:hookexec('leftColumn') leads to...

'HOOK_LEFT_COLUMN' => Module::hookExec('leftColumn'),

If someone would point me in the right direction, I'd be deeply grateful! This community is very helpful, with it's HOWTOs, and Prestashop is really really great! Thank you for it :lol: In the meantime, i'll continue with google! Let you know how it goes.

If I am not clear, please say so that I can explain further.


Edit 1:

Hi again. I am still digging. For the record, the hookexec "function" is located in the class classes/Module.php (I found out, after understanding that in Module::hookExec "Module" is the class and hookexec is the function.

Share this post

Link to post
Share on other sites

Well, I am here again.

You see, I have gotten no answers up to this point, because my question was vague and didn't come from understanding, but from not understanding. Now I understand a bit more, and will explain, just in case someone finds it useful.

When you make a default instalation - by clicking next, next, next, ok - what you do is install a portashop with several modules installed. These modules are what display the content on the website.

{$HOOK_LEFT_COLUMN}, despite being called a Hook, isn't a module itself... i'd call it a container. Several modules - ie, the tags module - modify the content of that "container".

If you want to have a fully personalized prestashop, you should choose "install with no modules" option, and then add some modules you find useful. If you want to modify the way the output is organized, you should go to the module folder.

Also, you can create your own modules, which can generate html and php code on the main content and on the two columns. It's pretty simple, a noob like me had no trouble with modifying pieces of it to fit my needs (after struggling for a few hours, of course).

There is a tutorial here:

You should follow it if you are attempting to adjust prestashop to a template, and the output of the hooks aren't good for you. Hope this is usefull to you! If need a hand, post here, and I'll try to help.


Share this post

Link to post
Share on other sites

Thank you Droope! I did find this very useful. As someone coming from a perl shopping cart that was as smooth as silk to configure, I am having a really hard time with these templates. This was definitely helpful and will hopefully get me in the right direction :)

Share this post

Link to post
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
Sign in to follow this  

  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More