hoatbui Posted August 23, 2013 Share Posted August 23, 2013 Hey guys, I'm not allowed to drag the "product specials" block into the middle homepage content section, it only hooks to the right or left column. Is there any way I can do this at the same time, will it look right? Because the current product specials block goes vertical and I would need it to lay horizontal on the middle section. Please help! Link to comment Share on other sites More sharing options...
vekia Posted August 24, 2013 Share Posted August 24, 2013 in this case you have to edit block specials module .php source. open main .php file of this module: blockspecials.php add there function like this: public function hookHome($params){ return $this->hookRightColumn($params); } Link to comment Share on other sites More sharing options...
hoatbui Posted August 27, 2013 Author Share Posted August 27, 2013 } public function hookRightColumn($params) { if (Configuration::get('PS_CATALOG_MODE')) return ; if (!($special = Product::getRandomSpecial((int)$params['cookie']->id_lang)) && !Configuration::get('PS_BLOCK_SPECIALS_DISPLAY')) return; $this->smarty->assign(array( 'special' => $special, 'priceWithoutReduction_tax_excl' => Tools::ps_round($special['price_without_reduction'], 2), 'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')), )); return $this->display(__FILE__, 'blockspecials.tpl'); } public function hookLeftColumn($params) { return $this->hookRightColumn($params); } public function hookHeader($params) { if (Configuration::get('PS_CATALOG_MODE')) return ; $this->context->controller->addCSS(($this->_path).'blockspecials.css', 'all'); } } vekia, im having trouble insert that code into this section, when i did, my site stopped loading. Link to comment Share on other sites More sharing options...
vekia Posted August 28, 2013 Share Posted August 28, 2013 you have to insert this code in correct place, where you inserted it? i don't se there any hookHome function Link to comment Share on other sites More sharing options...
hoatbui Posted September 5, 2013 Author Share Posted September 5, 2013 Hi Vekia, I added the code in between the last two } brackets and thats when it gave me the site error. Link to comment Share on other sites More sharing options...
vekia Posted September 5, 2013 Share Posted September 5, 2013 so it mean that there is something wrong with your code. can you show me how it looks right now? Link to comment Share on other sites More sharing options...
hoatbui Posted September 16, 2013 Author Share Posted September 16, 2013 so it mean that there is something wrong with your code. can you show me how it looks right now? } public function hookRightColumn($params) { if (Configuration::get('PS_CATALOG_MODE')) return ; if (!($special = Product::getRandomSpecial((int)$params['cookie']->id_lang)) && !Configuration::get('PS_BLOCK_SPECIALS_DISPLAY')) return; $this->smarty->assign(array( 'special' => $special, 'priceWithoutReduction_tax_excl' => Tools::ps_round($special['price_without_reduction'], 2), 'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')), )); return $this->display(__FILE__, 'blockspecials.tpl'); } public function hookLeftColumn($params) { return $this->hookRightColumn($params); } public function hookHeader($params) { if (Configuration::get('PS_CATALOG_MODE')) return ; $this->context->controller->addCSS(($this->_path).'blockspecials.css', 'all'); } public function hookHome($params){ return $this->hookRightColumn($params); } } 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