Guest Posted April 18, 2010 Share Posted April 18, 2010 Hi all,I wish transplant the top seller,new product modules into the center column in the home page.I did this by "BO >> Modules >> Positions >> Remove the original positions and transplant the modules to the hook of Homepage content"but they don't appear in the homepage. Maybe I need to alter CSS and smarty templates of the modules :take \modules\blockbestsellers\blockbestsellers.php for example: public function install() { if (!parent::install() OR !$this->registerHook('rightColumn') OR !$this->registerHook('updateOrderStatus') OR !ProductSale::fillProductSales()) return false; return true; } function hookRightColumn($params) { global $smarty; $currency = new Currency(intval($params['cookie']->id_currency)); $bestsellers = ProductSale::getBestSalesLight(intval($params['cookie']->id_lang), 0, 5); $best_sellers = array(); foreach ($bestsellers AS $bestseller) { $bestseller['price'] = Tools::displayPrice(Product::getPriceStatic(intval($bestseller['id_product'])), $currency); $best_sellers[] = $bestseller; } $smarty->assign(array( 'best_sellers' => $best_sellers, 'mediumSize' => Image::getSize('medium'))); return $this->display(__FILE__, 'blockbestsellers.tpl'); } function hookLeftColumn($params) { return $this->hookRightColumn($params); } Can anybody tell me how to modify the code or get me any idea? Link to comment Share on other sites More sharing options...
Guest Posted April 19, 2010 Share Posted April 19, 2010 Nobody advise how to do that? Link to comment Share on other sites More sharing options...
tomerg3 Posted April 19, 2010 Share Posted April 19, 2010 Not all modules have the ability to hook to all locations, it seems that this module is only set for left or right.You can try to manually add a new hook function, but it may not work if the .tpl /css is not set for it. function hookTop($params) { return $this->hookRightColumn($params); } Link to comment Share on other sites More sharing options...
Guest Posted April 19, 2010 Share Posted April 19, 2010 tomerg3 ,Thank you very much.I make it by: function hookHome($params) { return $this->hookRightColumn($params); } It works,thank you very much for your idea. Link to comment Share on other sites More sharing options...
OzWeb Posted July 2, 2010 Share Posted July 2, 2010 Hey guys, I want to do the same, move 'Top Seller' and 'Wish List' to the left column, can you guys tell me what tpl file and I need to add or remove. I don't know where should I put that function: function hookHome($params) { return $this->hookRightColumn($params); }ThanksRegards Link to comment Share on other sites More sharing options...
rocky Posted July 2, 2010 Share Posted July 2, 2010 Those modules can already be placed in the left column by default. Just go to Modules > Positions > Transplant a module, then choose the "Top sellers" or "Wishlist block" in the "Module" dropdown and "Left column blocks" in the "Hook into" dropdown, then click Save. You can then have these modules in both the left and right columns. Go back to Modules > Positions > Right column blocks and click the X next to the modules to delete them from the right column. Link to comment Share on other sites More sharing options...
OzWeb Posted July 2, 2010 Share Posted July 2, 2010 Thanks for your fast answer, I've tried to do what you say but I don't know why I see those option (the dropdown) but for some reason is locked and I can't modify it. Same with both modules. Do u know why?Thanks Link to comment Share on other sites More sharing options...
rocky Posted July 2, 2010 Share Posted July 2, 2010 That is normal behaviour and happens when you click the Edit buttons next to the modules. You should instead click the bold "Transplant a module" link at the top of the Modules > Positions section. Link to comment Share on other sites More sharing options...
OzWeb Posted July 2, 2010 Share Posted July 2, 2010 It works! Thank you so much...BUT now I have both blocks in both columns left and right :S Link to comment Share on other sites More sharing options...
rocky Posted July 2, 2010 Share Posted July 2, 2010 That is also normal behaviour. You need to go to Modules > Positions and then delete the modules from the "Right column blocks" section so that they are only in the left column. Link to comment Share on other sites More sharing options...
brandonc503 Posted October 1, 2010 Share Posted October 1, 2010 if i want the new products and best sellers in the home content, where do i put the ... function hookHome($params) { return $this->hookRightColumn($params); } Link to comment Share on other sites More sharing options...
rocky Posted October 1, 2010 Share Posted October 1, 2010 Put it in modules/blocknewproducts/blocknewproducts.php and modules/blockbestsellers/blockbestsellers.php before the last }. Link to comment Share on other sites More sharing options...
brandonc503 Posted October 1, 2010 Share Posted October 1, 2010 nm i found it.. i put function hookHome($params) { return $this->hookRightColumn($params); } as a new function at end of the blocknewproduct.php .. so that when i transplant it to the home hook it replicates what is done in the rightcolumn Link to comment Share on other sites More sharing options...
Recommended Posts