Jump to content

Calling A Module That's In The Header Hook - Need File And Proper Syntax.


Recommended Posts

Header Hook
This hook adds additional elements in the head section of your pages (head section of html).

I have 49 modules loaded in this hook and one of them is the 'Quick search block'.
How do I code the call to the 'Quick search block' and which .tpl file and/or other files do I call it from?
I am looking specifically for correct file(s) for the call and proper code and syntax syntax.

 

Note: I'm trying to call the module from the header.tpl and place the 'Quick search block' to the right side of my Banner block.

 

Any help would greatly be appreciated!

Jimmy Warren Jr.
Domain Technician
GMP Fashion Division

Link to comment
Share on other sites

Header hook places code inside the <head> tag (like css or javascript) and has nothing to do with the display position of the module inside the header of the page.

The Quick search block module that you see is from the hook displayTop.

It's not a good idea to call the module from inside the header.tpl, you should unhook the module from displaTop position and transplant it to another position.

Link to comment
Share on other sites

Of course. Go to YOUR_PRESTA/override/modules, create folder blocksearch and inside it create file blocksearch.php that will contain the following code:

<?php
if (!defined('_PS_VERSION_'))
  exit;

class BlockSearchOverride extends BlockSearch
{
  public function hookDisplayBanner($params)
  {
    return $this->hookTop($params);
  }
}

Link to comment
Share on other sites

Hi gabdara, Thanks for your help I did as you posted but the the 'displayBanner' hook still isn't available in the 'Transplant to' drop-down. Is there a process that I need to run in order to recompile the module. I tried to reset the module but Prestashop returned an error 'Cannot uninstall this module'. Please advise if you get a chance to.

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