32 lines
785 B
PHP
32 lines
785 B
PHP
|
<?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'));
|
||
|
}
|
||
|
|
||
|
}
|