32 lines
785 B
PHP
Raw Normal View History

2015-08-27 14:48:06 +02:00
<?php
class BlockBestSellersOverride extends BlockBestSellers
{
public function install()
{
if (!parent::install()
|| !$this->registerHook('displayHome')
)
return false;
return true;
}
public function hookdisplayHome($params)
{
if (!$this->isCached('blockbestsellers-home.tpl', $this->getCacheId('blockbestsellers-home')))
{
BlockBestSellers::$cache_best_sellers = $this->getBestSellers($params);
$this->smarty->assign(array(
'best_sellers' => BlockBestSellers::$cache_best_sellers,
'homeSize' => Image::getSize(ImageType::getFormatedName('home'))
));
}
if (BlockBestSellers::$cache_best_sellers === false)
return false;
return $this->display(__FILE__, 'blockbestsellers-home.tpl', $this->getCacheId('blockbestsellers-home'));
}
}