[email protected] Posted December 30, 2015 Share Posted December 30, 2015 Header HookThis 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 TechnicianGMP Fashion Division Link to comment Share on other sites More sharing options...
gabdara Posted December 30, 2015 Share Posted December 30, 2015 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 More sharing options...
[email protected] Posted December 30, 2015 Author Share Posted December 30, 2015 Hi, thanks for your response. I attempted to do that but the hook that I wanted to transplant to was not available in the drop-down, that hook was 'displayBanner'. Do you know how to make the 'displayBanner' hook available in the drop-down to facilitate the transplant? Link to comment Share on other sites More sharing options...
gabdara Posted December 30, 2015 Share Posted December 30, 2015 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 More sharing options...
[email protected] Posted December 31, 2015 Author Share Posted December 31, 2015 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 More sharing options...
[email protected] Posted December 31, 2015 Author Share Posted December 31, 2015 Hi, just to add I deleted the /cache/class_index.php file and Prestashop regenerated it but still didn't add the displayBanner hook to the available hooks for the Quick search block. Link to comment Share on other sites More sharing options...
gabdara Posted December 31, 2015 Share Posted December 31, 2015 What version of PrestaShop do you have? This feature of override module php file was introduced from 1.6.0.11. I've tested the code I've provided on 1.6.1.3 and it worked. Also try to clear the smarty cache. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now