jxdyzwh Posted November 11, 2013 Share Posted November 11, 2013 This module cannot be transplanted to this hook,How can i do it Link to comment Share on other sites More sharing options...
Alex Simonchik BelVG Posted November 11, 2013 Share Posted November 11, 2013 Hi, you need to change install() function and include hook what you need: this->registerHook('displayFooter'). After that copy logic from function hookLeftColumn() (if you need this logic) to hookDisplayFooter (new hook) Regards Link to comment Share on other sites More sharing options...
vekia Posted November 11, 2013 Share Posted November 11, 2013 it's easy to fix, here is the full solution modified blocklink.php http://pastebin.com/66j9JfxB paste this code into your blocklink.php file (/modules/blocklink/blocklink.php) and then try to transplant module to footer section Link to comment Share on other sites More sharing options...
Alex Simonchik BelVG Posted November 11, 2013 Share Posted November 11, 2013 Hi Vekia, I am sorry but in your install() function I can't see "!$this->registerHook('footer') ||" so I think function "hookFooter($params)" is not be call. Am I right? Link to comment Share on other sites More sharing options...
vekia Posted November 11, 2013 Share Posted November 11, 2013 It's not necessary. you have to create function hookFooter($params) only, then you will be able to transplant module to this hook. you can transplant module to new hook without registerhook in install() function Link to comment Share on other sites More sharing options...
Alex Simonchik BelVG Posted November 11, 2013 Share Posted November 11, 2013 Wow, I didn't know it later, thank you Link to comment Share on other sites More sharing options...
twiggs Posted November 28, 2013 Share Posted November 28, 2013 it's easy to fix, here is the full solution modified blocklink.php http://pastebin.com/66j9JfxB paste this code into your blocklink.php file (/modules/blocklink/blocklink.php) and then try to transplant module to footer section Hi there, I'm new to prestashop and have the same error message as the OP when trying to transplant a module to the page header. Do I just copy and paste http://pastebin.com/66j9JfxB code to blocklink.php too? Link to comment Share on other sites More sharing options...
vekia Posted November 28, 2013 Share Posted November 28, 2013 page header is a invisible hook. you probably mean that you want to use it in displayTop hook ? Link to comment Share on other sites More sharing options...
twiggs Posted December 1, 2013 Share Posted December 1, 2013 Hi vekia, I've doubled checked the theme documentation, is page header hook. Is there a way to do it? page header is a invisible hook. you probably mean that you want to use it in displayTop hook ? Link to comment Share on other sites More sharing options...
ibndawood Posted December 1, 2013 Share Posted December 1, 2013 pageHeader hook is called in header.tpl just before closing the <head> tag. Module developers usually use this hook to inject javascript, CSS and meta tags that go in between the <head> tags. May I ask you what module you are trying to transplant to which hook ? Link to comment Share on other sites More sharing options...
twiggs Posted December 1, 2013 Share Posted December 1, 2013 Hi there, I am trying to transplant a Mega Category module to the displayHeader pageHeader hook is called in header.tpl just before closing the <head> tag. Module developers usually use this hook to inject javascript, CSS and meta tags that go in between the <head> tags. May I ask you what module you are trying to transplant to which hook ? Link to comment Share on other sites More sharing options...
ibndawood Posted December 1, 2013 Share Posted December 1, 2013 I suspect it is displayTop as vekia said. Can u please confirm ? Link to comment Share on other sites More sharing options...
twiggs Posted December 1, 2013 Share Posted December 1, 2013 I suspect it is displayTop as vekia said. Can u please confirm ? Is displayHeader based on theme author's documentation. Link to comment Share on other sites More sharing options...
ibndawood Posted December 1, 2013 Share Posted December 1, 2013 Open your module class file (which ends with .php) and search for function hookDisplayHeader(). If you do not find this word , then your module cannot be hooked to header. Link to comment Share on other sites More sharing options...
twiggs Posted December 1, 2013 Share Posted December 1, 2013 Open your module class file (which ends with .php) and search for function hookDisplayHeader(). If you do not find this word , then your module cannot be hooked to header. I'm sorry, where do I locate the module class file? Link to comment Share on other sites More sharing options...
ibndawood Posted December 1, 2013 Share Posted December 1, 2013 Look into your module folder. The module class file is usually named like <modulename>.php So for example if your module folder is blockmegacategory your module class file is usually blockmegacategory.php Link to comment Share on other sites More sharing options...
twiggs Posted December 1, 2013 Share Posted December 1, 2013 (edited) Got it! Thanks for your patience and help. There is no function hookdisplayheader() in the file. What is the correct code syntax to add the function? I've more newbie questions if you don't mind. The purchased theme do not work with themeinstaller. If the displayheader is an invisible hook, is it bad practice to hook modules to it manually? The theme's author has many own developed modules. I have run into same issues with other modules where I have the error message "this module cannot be transplanted to this hook". Does it reflect anything on the quality of the theme in terms of the backend development? Edited December 1, 2013 by twiggs (see edit history) Link to comment Share on other sites More sharing options...
ibndawood Posted December 1, 2013 Share Posted December 1, 2013 In your theme file there is a file header.tpl. If you open it up you will find {$HOOK_HEADER} in most cases it is within the <head> tag (thats why it is an invisible hook). You don't see in the page the code that is within the <head> tag. The purpose of $HOOK_HEADER is to allow module developers to add code that they want within the <head> tag. Usually it is javascript files, css files and meta tags. Other than these reasons a module developer will not be using displayHeader hook. A module may or may not require to be hooked to displayHeader. So without taking a look at the code I cannot really say whether we need to hook it to displayHeader or not. If the purchased theme does not work with theme installer then it is simply that the theme developer does not choose to support installation via theme installer. Its an extra step that theme developer would take to make things easy for the buyer. Link to comment Share on other sites More sharing options...
twiggs Posted December 1, 2013 Share Posted December 1, 2013 Thanks ibndawood for the help. Not sure if it is the case for Prestashop's themes, it has been a very frustrating and time consuming process to get this theme works. The theme author is non native English speaker and that adds effort for clarification. I think I'm going to try Prestashop at a later time. Link to comment Share on other sites More sharing options...
vekia Posted December 1, 2013 Share Posted December 1, 2013 i think that theme developer made mistake, displayHeader - it's not header of what you see in your theme, header is an in visible hook displayTop - it's a visible part of theme, sometimes called as page "header" Link to comment Share on other sites More sharing options...
twiggs Posted December 5, 2013 Share Posted December 5, 2013 i think that theme developer made mistake, displayHeader - it's not header of what you see in your theme, header is an in visible hook displayTop - it's a visible part of theme, sometimes called as page "header" Out of curiosity, hooking category and right column modules to displayHeader, is this consider a bad practice for prestashop? Link to comment Share on other sites More sharing options...
vekia Posted December 5, 2013 Share Posted December 5, 2013 everything depends on what you want to display there. if you want to "display" (attach) files like js/css maybe some <script> code - everything is ok. if you want to attach there <div> or any other VISIBLE content - it's definitely bad practice. Link to comment Share on other sites More sharing options...
ibndawood Posted December 6, 2013 Share Posted December 6, 2013 As I said before and as vekia mentioned hookHeader module is for loading CSS and JS files required for that module and most modules make use of that hook. All modules hooked to header will also be hooked to other places (since header is not used for display). Its on how you use the hook is what defines bad practice. Link to comment Share on other sites More sharing options...
twiggs Posted December 8, 2013 Share Posted December 8, 2013 (edited) Thanks vekia and ibndawood. I've another question if you don't mind. What is the average loading speed for prestashop. It seems to be very slow. And what is the recommended hosting specs? Edited December 8, 2013 by twiggs (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted December 9, 2013 Share Posted December 9, 2013 everything depends on your hosting account, and also on how many products you've got (in simple words) usually, fresh installation on my hosting takes about 0,9 first load all other pages loads in 0,4-0,6 1 Link to comment Share on other sites More sharing options...
andrefadila Posted March 5, 2014 Share Posted March 5, 2014 (edited) it's easy to fix, here is the full solution modified blocklink.php http://pastebin.com/66j9JfxB paste this code into your blocklink.php file (/modules/blocklink/blocklink.php) and then try to transplant module to footer section Hi mod, I was tried your solution but I couldn't transplanted to displayFooter hook. I was trying to hook the store locator block. Edited March 5, 2014 by andrefadila (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted March 5, 2014 Share Posted March 5, 2014 can you show your modified code of block stores module, please? Link to comment Share on other sites More sharing options...
andrefadila Posted March 5, 2014 Share Posted March 5, 2014 can you show your modified code of block stores module, please? Actually, I am not modified that. I am using Presta 1.5.6.1 The blockstore.php : http://pastebin.com/PZGnSEcK Link to comment Share on other sites More sharing options...
vekia Posted March 6, 2014 Share Posted March 6, 2014 without modification it will not work. you ahve to add displayFooter support to this module. Link to comment Share on other sites More sharing options...
andrefadila Posted March 6, 2014 Share Posted March 6, 2014 without modification it will not work. you ahve to add displayFooter support to this module. Hmm, thanks mod. Link to comment Share on other sites More sharing options...
Recommended Posts