Ben90 Posted November 16, 2014 Share Posted November 16, 2014 Hi guys, Just a quick question, I would like to move New Products Block to displayHome (Homepage content) but this notification appeared when I try to do it: This module cannot be transplanted to this hook Is there any way to do this? I just simply want to move this "new arrival products" to appear on the bottom of the homepage content. I thank you in advance for your help Link to comment Share on other sites More sharing options...
LuckyModule Posted November 17, 2014 Share Posted November 17, 2014 Hi guys, Just a quick question, I would like to move New Products Block to displayHome (Homepage content) but this notification appeared when I try to do Hello, Add this file - modules\blocknewproducts\blocknewproducts.php This code after line 180 public function hookDisplayHome($params) { if (!$this->isCached('blocknewproducts_home.tpl', $this->getCacheId('blocknewproducts-home'))) { $this->smarty->assign(array( 'new_products' => BlockNewProducts::$cache_new_products, 'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')), 'homeSize' => Image::getSize(ImageType::getFormatedName('home')) )); } if (BlockNewProducts::$cache_new_products === false) return false; return $this->display(__FILE__, 'blocknewproducts_home.tpl', $this->getCacheId('blocknewproducts-home')); } 2 Link to comment Share on other sites More sharing options...
Ben90 Posted November 17, 2014 Author Share Posted November 17, 2014 Hello, Add this file - modules\blocknewproducts\blocknewproducts.php This code after line 180 public function hookDisplayHome($params) { if (!$this->isCached('blocknewproducts_home.tpl', $this->getCacheId('blocknewproducts-home'))) { $this->smarty->assign(array( 'new_products' => BlockNewProducts::$cache_new_products, 'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')), 'homeSize' => Image::getSize(ImageType::getFormatedName('home')) )); } if (BlockNewProducts::$cache_new_products === false) return false; return $this->display(__FILE__, 'blocknewproducts_home.tpl', $this->getCacheId('blocknewproducts-home')); } Thank you so much! Much appreciated! It works perfectly! Link to comment Share on other sites More sharing options...
Ben90 Posted November 17, 2014 Author Share Posted November 17, 2014 (edited) Hello, Add this file - modules\blocknewproducts\blocknewproducts.php This code after line 180 public function hookDisplayHome($params) { if (!$this->isCached('blocknewproducts_home.tpl', $this->getCacheId('blocknewproducts-home'))) { $this->smarty->assign(array( 'new_products' => BlockNewProducts::$cache_new_products, 'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')), 'homeSize' => Image::getSize(ImageType::getFormatedName('home')) )); } if (BlockNewProducts::$cache_new_products === false) return false; return $this->display(__FILE__, 'blocknewproducts_home.tpl', $this->getCacheId('blocknewproducts-home')); } Hi, there's a problem with this new products block module. After I move it down to displayHome (Homepage content), it last for 1 day, after that it shown "no new products at this time" even though I set the products considered new to 30 days. I need to reset the module to make them appear again, but after I move it to displayHome (Homepage content), it happened again. Maybe there's additional set of code I need to add? I just want to add this new products in the displayHome (Homepage content). So I remove it from another hook (left side bar or anywhere else). Guess this code need to be modified, right? if ($success) { // Hook the module either on the left or right column $theme = new Theme(Context::getContext()->shop->id_theme); if ((!$theme->default_left_column || !$this->registerHook('leftColumn')) && (!$theme->default_right_column || !$this->registerHook('rightColumn'))) { // If there are no colums implemented by the template, throw an error and uninstall the module $this->_errors[] = $this->l('This module need to be hooked in a column and your theme does not implement one'); parent::uninstall(); return false; } } Edited November 18, 2014 by rukano (see edit history) Link to comment Share on other sites More sharing options...
Miguel86 Posted November 19, 2014 Share Posted November 19, 2014 Hi WebtetDev I have the same problem as rukano, worked at the begining but after some time stopped working until i reset the module, etc Any help? Best regards. Link to comment Share on other sites More sharing options...
LuckyModule Posted November 19, 2014 Share Posted November 19, 2014 Hi WebtetDev I have the same problem as rukano, worked at the begining but after some time stopped working until i reset the module, etc Any help? Best regards. Hello, After line 52 past this code - $this->registerHook('displayHome') && and after line 199 past - public function hookDisplayHome($params) { return $this->hookdisplayHomeTabContent($params); } Link to comment Share on other sites More sharing options...
Miguel86 Posted November 19, 2014 Share Posted November 19, 2014 (edited) Hi:UPDATED another time: Seems that after some time continue failing Thanks Best regards. Edited November 19, 2014 by Miguel86 (see edit history) Link to comment Share on other sites More sharing options...
Miguel86 Posted November 19, 2014 Share Posted November 19, 2014 Resetted and seems to start working and after some time stops another time Link to comment Share on other sites More sharing options...
Ben90 Posted November 19, 2014 Author Share Posted November 19, 2014 Hello, After line 52 past this code - $this->registerHook('displayHome') && and after line 199 past - public function hookDisplayHome($params) { return $this->hookdisplayHomeTabContent($params); } Yeah still the same, unless I left the left column active. But there's no point using both of them on the same page. Put this on displayHome is the best idea. Still not working though... Link to comment Share on other sites More sharing options...
Miguel86 Posted November 20, 2014 Share Posted November 20, 2014 Hi:Me too, i tried it another time and the same Maeby need to register another hook or anything else... Best regards. Link to comment Share on other sites More sharing options...
Ben90 Posted November 26, 2014 Author Share Posted November 26, 2014 Still no light to this case? Link to comment Share on other sites More sharing options...
Recommended Posts