Skip to content
This repository was archived by the owner on Dec 1, 2020. It is now read-only.

[-] MO : hookDisplayHome not displaying #10

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update blockbestsellers.php
gRoussac committed Jan 21, 2016
commit 2d929689530c6a625a4e114876e670b9b7f42a6a
11 changes: 10 additions & 1 deletion blockbestsellers.php
Original file line number Diff line number Diff line change
@@ -204,7 +204,7 @@ public function hookDisplayHomeTab($params)
{
if (!$this->isCached('tab.tpl', $this->getCacheId('blockbestsellers-tab')))
{
BlockBestSellers::$cache_best_sellers = $this->getBestSellers($params);
$this->_cacheProducts($params);
$this->smarty->assign('best_sellers', BlockBestSellers::$cache_best_sellers);
}

@@ -218,6 +218,7 @@ public function hookDisplayHome($params)
{
if (!$this->isCached('blockbestsellers-home.tpl', $this->getCacheId('blockbestsellers-home')))
{
$this->_cacheProducts($params);
$this->smarty->assign(array(
'best_sellers' => BlockBestSellers::$cache_best_sellers,
'homeSize' => Image::getSize(ImageType::getFormatedName('home'))
@@ -260,6 +261,14 @@ public function hookLeftColumn($params)
return $this->hookRightColumn($params);
}

protected function _cacheProducts($params)
{
if (!isset(BlockBestSellers::$cache_best_sellers)) {
BlockBestSellers::$cache_best_sellers = $this->getBestSellers($params);
}
return BlockBestSellers::$cache_best_sellers;
}

protected function getBestSellers($params)
{
if (Configuration::get('PS_CATALOG_MODE'))