Jump to content

Change position to blocks?


Recommended Posts

The specials block was not designed to be placed in the centre column. You'd have to modify code to add this capability. For example, add the following to modules/blockspecials/blockspecials.tpl:

function hookHome($params)
{
  global $smarty;

  if ($special = Product::getRandomSpecial(intval($params['cookie']->id_lang)))
      $smarty->assign(array(
      'special' => $special,
      'oldPrice' => $special['price'] + $special['reduction'],
      'mediumSize' => Image::getSize('medium')));

  return $this->display(__FILE__, 'blockspecials-home.tpl');
}



Then copy blockspecials.tpl to blockspecials-home.tpl and modify it so it looks how you want in the center column. You can then go to Modules > Positions > Transplant a module and place the "Specials block" into the "Homepage content" hook.

You can put the module in multiple positions by going to Modules > Positions > Transplant a module to copying the specials block into another position. Since the module calls the getRandomSpecial function, I think it should display different specials. This won't let you put the module multiple times in the same hook though. To do that, you'll have to copy the blockspecials module to create a blockspecials2 module and change blockspecials.php to blockspecials2.php and in that file, change:

class BlockSpecials extends Module



to:

class BlockSpecials2 extends Module



and:

$this->name = 'blockspecials';



to:

$this->name = 'blockspecials2';



You can do this again with 3 instead of 2 if you need the module three times in the same hook.

Link to comment
Share on other sites

Go to Modules > Positions, then in the "Left column blocks" or "Right column blocks" section, click on up or down arrows to move the module up or down one position. You can click and drag the background behind the arrows to move the modules multiple positions at a time.

Link to comment
Share on other sites

  • 1 year later...

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...