shniurs Posted March 18, 2014 Share Posted March 18, 2014 Hi, anyone knows how do I get rid of the homepage tabs? I want to display new products and best sellers block one after another. I've tried to hook these blocks into displayHome - but it seems I cant hook these modules into displayHome. Any ideas? Thanks! Link to comment Share on other sites More sharing options...
vekia Posted March 19, 2014 Share Posted March 19, 2014 hello unhook these modules from: displayHomeTabContent displayHomeTab and attach them to displayHome 2 Link to comment Share on other sites More sharing options...
prestamax Posted March 19, 2014 Share Posted March 19, 2014 hello unhook these modules from: displayHomeTabContent displayHomeTab and attach them to displayHome Unfortunately this is not possible. In order to hook them to displayHome it would be necessary to add this hook to homefeatured.php in the module folder /modules/homefeatured/ The only hook that is allowed here is displayHomeTab. In order to being able to hook the module to displayHome it would be necessary to add another line || !$this->registerHook('displayHome') Link to comment Share on other sites More sharing options...
shniurs Posted March 19, 2014 Author Share Posted March 19, 2014 Vekia - that's what I was trying to do, but it cannot be hooked, just like I've said in my post. prestamax - Thank you! That's what I needed, to add a hook, simple when you know it Thanks a lot! Link to comment Share on other sites More sharing options...
vekia Posted March 21, 2014 Share Posted March 21, 2014 it's not necessary to register hook, you can just simply transplant modules without registerhook, the only one thing that is necessary is a function to handle this hook. but in fact - this function already exists, so all you have to do is just simple transplantation in back office without any kind of modification in module .php file. 1 Link to comment Share on other sites More sharing options...
vekia Posted March 21, 2014 Share Posted March 21, 2014 Unfortunately this is not possible. In order to hook them to displayHome it would be necessary to add this hook to homefeatured.php in the module folder /modules/homefeatured/ The only hook that is allowed here is displayHomeTab. In order to being able to hook the module to displayHome it would be necessary to add another line || !$this->registerHook('displayHome') it's not necessary to register hook, you can just simply transplant modules without registerhook, the only one thing that is necessary is a function to handle this hook. but in fact - this function already exists, so all you have to do is just simple transplantation in back office without any kind of modification in module .php file. Link to comment Share on other sites More sharing options...
prestamax Posted March 21, 2014 Share Posted March 21, 2014 it's not necessary to register hook, you can just simply transplant modules without registerhook, the only one thing that is necessary is a function to handle this hook. but in fact - this function already exists, so all you have to do is just simple transplantation in back office without any kind of modification in module .php file. vekia, what function do you mean? When I tried to hook homefeatured to displayHome I got the message that the module could not be hooked to this position. This is why I added the hook to homefeatured.php. Then it was possible to hook it to displayHome. Link to comment Share on other sites More sharing options...
benjamin utterback Posted March 21, 2014 Share Posted March 21, 2014 vekia, what function do you mean? When I tried to hook homefeatured to displayHome I got the message that the module could not be hooked to this position. This is why I added the hook to homefeatured.php. Then it was possible to hook it to displayHome. The same thing happened when I did it. Vekia, were you able to correctly transplant? is it different in 1.6 version than 1.5? Link to comment Share on other sites More sharing options...
vekia Posted March 21, 2014 Share Posted March 21, 2014 The same thing happened when I did it. Vekia, were you able to correctly transplant? is it different in 1.6 version than 1.5? Of course that i tested it in 1.6 and yes, im able to transplant it without any modification of module file, it's because function hookdisplayHome already exists in this addon (from 1.5 release) public function hookDisplayHome($params) { if (!$this->isCached('homefeatured.tpl', $this->getCacheId())) { $this->_cacheProducts(); $this->smarty->assign( array( 'products' => HomeFeatured::$cache_products, 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'homeSize' => Image::getSize(ImageType::getFormatedName('home')), ) ); } return $this->display(__FILE__, 'homefeatured.tpl', $this->getCacheId()); } To transplant addon it's not necessary to register hook. The only one requirement is function to handle this hook. check video (i recorded it especially for this case) 1 Link to comment Share on other sites More sharing options...
GrandNagus Posted March 26, 2014 Share Posted March 26, 2014 Hi, What about re-ordering the tabs? So make new products last rather than first? Cheers Link to comment Share on other sites More sharing options...
vekia Posted March 27, 2014 Share Posted March 27, 2014 modules > positions search for displayHomeTab and change position of any module you want. 1 Link to comment Share on other sites More sharing options...
tolo_mir Posted April 4, 2014 Share Posted April 4, 2014 Hi, I would like to know how I can move the "displayHome" module just above the "displayHomeTabs". Is there any way to do it? Thanks in advance! Tolo Link to comment Share on other sites More sharing options...
zberg007 Posted April 26, 2014 Share Posted April 26, 2014 hello unhook these modules from: displayHomeTabContent displayHomeTab and attach them to displayHome What if you don't have these in your positions? I upgraded from 1.5 but these are missing entirely. Thanks much in advance! Z Link to comment Share on other sites More sharing options...
vekia Posted April 26, 2014 Share Posted April 26, 2014 are you able to manage your database with phpmyadmin or any other similar script? Link to comment Share on other sites More sharing options...
zberg007 Posted April 26, 2014 Share Posted April 26, 2014 Yes, I am... Link to comment Share on other sites More sharing options...
vekia Posted April 26, 2014 Share Posted April 26, 2014 ok great, so open it and go to the ps_hook table are hooks mentioned before exist in this table? 1 Link to comment Share on other sites More sharing options...
zberg007 Posted April 26, 2014 Share Posted April 26, 2014 As a matter of fact, they are! Not sure what I need to edit however. Thanks again in advance for your help! Z Link to comment Share on other sites More sharing options...
vekia Posted April 26, 2014 Share Posted April 26, 2014 strange, have you tried to clear shop cache? Link to comment Share on other sites More sharing options...
zberg007 Posted April 26, 2014 Share Posted April 26, 2014 Yes, several times. :/ I've also logged in from different browsers both in SSL and without. Same results... Link to comment Share on other sites More sharing options...
vekia Posted April 26, 2014 Share Posted April 26, 2014 these hooks have got position field equal to 1 ? Link to comment Share on other sites More sharing options...
zberg007 Posted April 26, 2014 Share Posted April 26, 2014 Thanks vekia! I ended up manually updating the positions and that solved my issue. Thanks again for all your help! Best, Z Link to comment Share on other sites More sharing options...
George.Gall Posted April 28, 2014 Share Posted April 28, 2014 Hi, I would like to know how I can move the "displayHome" module just above the "displayHomeTabs". Is there any way to do it? Thanks in advance! Tolo Yes , it is possible. Unfortunately not from backoffice. You will need to modify the INDEX.TPL inside your theme folder. There are two hooks . First the HomeTabs then displayHome. Just invert them. So to make things clearer here is the default index.tpl : {if isset($HOOK_HOME_TAB_CONTENT) && $HOOK_HOME_TAB_CONTENT|trim} {if isset($HOOK_HOME_TAB) && $HOOK_HOME_TAB|trim} <ul id="home-page-tabs" class="nav nav-tabs clearfix"> {$HOOK_HOME_TAB} </ul> {/if} <div class="tab-content">{$HOOK_HOME_TAB_CONTENT}</div> {/if} {if isset($HOOK_HOME) && $HOOK_HOME|trim} <div class="clearfix">{$HOOK_HOME}</div> {/if} you will have to invert them to : {if isset($HOOK_HOME) && $HOOK_HOME|trim} <div class="clearfix">{$HOOK_HOME}</div> {/if} {if isset($HOOK_HOME_TAB_CONTENT) && $HOOK_HOME_TAB_CONTENT|trim} {if isset($HOOK_HOME_TAB) && $HOOK_HOME_TAB|trim} <ul id="home-page-tabs" class="nav nav-tabs clearfix"> {$HOOK_HOME_TAB} </ul> {/if} <div class="tab-content">{$HOOK_HOME_TAB_CONTENT}</div> {/if} And magic ... they are inverted Happy shopping. Rate if you find it usefull. 2 Link to comment Share on other sites More sharing options...
CJH Posted June 3, 2014 Share Posted June 3, 2014 I also would like to change the order of the tabs on the home page - as in post #11. And perhaps add more ... But I have no section for displayHomeTabs so have nowhere to be able to switch positions. They aren't there in my install of v1.6.0.6 - the positions list goes from displayHome to displayInvoice. Where can I find the positions to change over? Link to comment Share on other sites More sharing options...
CJH Posted June 4, 2014 Share Posted June 4, 2014 Answering my own question - I found that the section for displayHomeTabs was not showing until the checkbox for displaying non-positionable tabs was displayed; then it worked Link to comment Share on other sites More sharing options...
Mister Denial Posted June 11, 2014 Share Posted June 11, 2014 So, I tried both adding the hook code in the tpl file as suggested at the beginning of this topic, and also checked the hooks table, nothing will work. The home featured products yes, they can be hooked into displayHome without problem, but not the best sellers block. So is there any other way to display the New products and the featured products below each other, instead of tabbed? Link to comment Share on other sites More sharing options...
kapees Posted June 26, 2014 Share Posted June 26, 2014 What about if the situation is opposite. I did reset "home featured products", "new products" and "best sellers" modules and since that time home page tabs doesn't work any more. All of those modules display under themselves. I can not add "best sellers" product to homepagetab as well Link to comment Share on other sites More sharing options...
sushreem Posted July 1, 2014 Share Posted July 1, 2014 I too am not able to add top sellers and new products blocks to displayHome. Any idea any one? Using 1.6. Link to comment Share on other sites More sharing options...
vekia Posted July 1, 2014 Share Posted July 1, 2014 prestashop 1.6 doesnt allow to display these modules in displayHome tab it's because modules support only displayHomeTabContents only. if you want to move these modules there it's necessary to modify these modules. for exmaple ,for new products you can use this one: http://www.prestashop.com/forums/topic/278949-free-module-homepage-featured-new-products-block/ but it's not fully ready for 1.6 1 Link to comment Share on other sites More sharing options...
sushreem Posted July 3, 2014 Share Posted July 3, 2014 Thanks Vekia. will wait for it to be ready for 1.6. Link to comment Share on other sites More sharing options...
Zeryk Posted September 1, 2014 Share Posted September 1, 2014 The same thing happened when I did it. Vekia, were you able to correctly transplant? is it different in 1.6 version than 1.5? I have same problem , I cant transplant the hook. Im trying to get block On Sale products on home page tab , just next to the New products. Actually non of the blocks can be hooked there. Always get the same Red answer. Cant be hooked.:-( My be need to check something somewhere? Link to comment Share on other sites More sharing options...
joseagro Posted October 9, 2014 Share Posted October 9, 2014 Hello everybody, i´m with the same problem here, any solution? Thanks in advance Link to comment Share on other sites More sharing options...
taoufiqaitali Posted November 20, 2014 Share Posted November 20, 2014 hello unhook these modules from: displayHomeTabContent displayHomeTab and attach them to displayHome possible to hook featured product in displayHome but for new product module and best seller module you need to add this public function hookDisplayHome($params) { $this->hookdisplayHomeTabContent($params); } to php file (tested in ps 1.6.0.9) 1 Link to comment Share on other sites More sharing options...
yasaman Posted November 23, 2014 Share Posted November 23, 2014 thank you,it works for me,i have another question .when i hook newproduct module to homepage ,it doesn't have any title.how can i fix it with a title? Link to comment Share on other sites More sharing options...
George.Gall Posted November 23, 2014 Share Posted November 23, 2014 thank you,it works for me,i have another question .when i hook newproduct module to homepage ,it doesn't have any title.how can i fix it with a title? You should go into themes/Yourtheme/modules/blocknewproducts/ and edit the blocknewproducts_home.tpl look for {if isset($new_products) && $new_products} and right after it on a new line add : <h4 class="title_block">{l s='New products' mod='blocknewproducts'}</h4> It should work, I have no way to test right now , as my local version is a bit messed up Let me know how it went. Always make a back-up of the original file just in case. 1 Link to comment Share on other sites More sharing options...
yasaman Posted November 24, 2014 Share Posted November 24, 2014 thanks Goerge ,it was fixed with that line.that really help me,i took 4 hours to resolve it ,thanks again. Link to comment Share on other sites More sharing options...
George.Gall Posted November 24, 2014 Share Posted November 24, 2014 thanks Goerge ,it was fixed with that line.that really help me,i took 4 hours to resolve it ,thanks again. I am glad I could be of help. Cheers. 1 Link to comment Share on other sites More sharing options...
yasaman Posted November 24, 2014 Share Posted November 24, 2014 i need to change the position of new products and best sellers and specials and hook them to hoe position ,when their position changed their title doesn't shown,as Goerge said i add that line to the blocknewproducts-home.tpl.but when i do that to best sellers they start to show there isn't any product.i 'm really confused pelease help me in that. Link to comment Share on other sites More sharing options...
George.Gall Posted November 24, 2014 Share Posted November 24, 2014 (edited) i need to change the position of new products and best sellers and specials and hook them to hoe position ,when their position changed their title doesn't shown,as Goerge said i add that line to the blocknewproducts-home.tpl.but when i do that to best sellers they start to show there isn't any product.i 'm really confused pelease help me in that. Different modules might need different approaches. Let me look into the Best sellers module. I will come back with an answer. EDIT: Ok, so for the best sellers you need to look for {if isset($best_sellers) && $best_sellers} and add after it on a new line : <h4 class="title_block">{l s='Top sellers' mod='blockbestsellers'}</h4> Edited November 24, 2014 by George.Gall (see edit history) Link to comment Share on other sites More sharing options...
yasaman Posted November 25, 2014 Share Posted November 25, 2014 i added the correct line to each module and they show the title correctly but without any content they show the blue box showing when there isn't any product("No new products at this time").i deleted the cashe in cashe/smarty it came true first but messed up now again.. Link to comment Share on other sites More sharing options...
yasaman Posted November 25, 2014 Share Posted November 25, 2014 now i find something else,if for examle newproduct module hooked in right column too ,it 's product come truely in home position too but when i unhook it from right column it's content didn't show. Link to comment Share on other sites More sharing options...
George.Gall Posted November 25, 2014 Share Posted November 25, 2014 now i find something else,if for examle newproduct module hooked in right column too ,it 's product come truely in home position too but when i unhook it from right column it's content didn't show. Could you share a link to the site ? Link to comment Share on other sites More sharing options...
yasaman Posted November 25, 2014 Share Posted November 25, 2014 it's in my local,i dont know how can i share it for you and also in persian language Link to comment Share on other sites More sharing options...
mahusbestofplus Posted November 25, 2014 Share Posted November 25, 2014 Hello everybody! I need your help because I have an issue with my home-feature products: It does not appear when I load my homepage, I only have the link in the tab to show it. What can I do to solve the bug? If you have any solutions, it would be really great! Thank you! Jaques Link to comment Share on other sites More sharing options...
George.Gall Posted November 25, 2014 Share Posted November 25, 2014 (edited) it's in my local,i dont know how can i share it for you and also in persian language This happens because the hook is trying to display the tabed content , but you just unhooked the tab from displayhometabcontent thus nothing is displaying. I am looking for a solution. Hello everybody! I need your help because I have an issue with my home-feature products: It does not appear when I load my homepage, I only have the link in the tab to show it. What can I do to solve the bug? If you have any solutions, it would be really great! Thank you! Jaques Could you share a link or do you work in local too , like yasaman ? Edited November 25, 2014 by George.Gall (see edit history) Link to comment Share on other sites More sharing options...
George.Gall Posted November 25, 2014 Share Posted November 25, 2014 possible to hook featured product in displayHome but for new product module and best seller module you need to add this public function hookDisplayHome($params) { $this->hookdisplayHomeTabContent($params); } to php file (tested in ps 1.6.0.9) Ok , so the solution was fairly simple. taoufiqaitali added only the tab content to the displayhome hook, but in fact the displayhometab and displayhometabcontent are related because the actual caching happens in the tab. The CORRECT solution is to edit the blocknewproducts.php in the prestashop_folder/modules/blocknewproducts/ and add this code wherever you want. public function hookDisplayHome($params) { $this->hookdisplayHomeTab($params); $this->hookdisplayHomeTabContent($params); } Link to comment Share on other sites More sharing options...
mahusbestofplus Posted November 26, 2014 Share Posted November 26, 2014 Could you share a link or do you work in local too , like yasaman ? Sadely yes, I work in local too. Link to comment Share on other sites More sharing options...
totallighting.sk Posted January 2, 2015 Share Posted January 2, 2015 hello unhook these modules from: displayHomeTabContent displayHomeTab and attach them to displayHome Thanks, it works, and also add this: http://www.prestashop.com/forums/topic/316661-random-home-featured-in-v16/page-2 Link to comment Share on other sites More sharing options...
Recommended Posts