Jump to content

How to get "product specials" module to middle homepage content


Recommended Posts

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

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

}
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

  • 2 weeks later...
  • 2 weeks later...

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...