// MERGE with 1.4 r7770
This commit is contained in:
1 parent
60b07cacb9
commit
c17e7c236d
968 files changed
+26082
-3937
No files matched your search
@@ -105,14 +105,18 @@ class BlockBestSellers extends Module
|
||||
if (!$bestsellers AND !Configuration::get('PS_BLOCK_BESTSELLERS_DISPLAY'))
|
||||
return;
|
||||
$best_sellers = array();
|
||||
|
||||
if($bestsellers)
|
||||
foreach ($bestsellers AS $bestseller)
|
||||
{
|
||||
$bestseller['price'] = Tools::displayPrice(Product::getPriceStatic((int)($bestseller['id_product'])), $currency);
|
||||
$best_sellers[] = $bestseller;
|
||||
}
|
||||
|
||||
$context->smarty->assign(array(
|
||||
'best_sellers' => $best_sellers,
|
||||
'mediumSize' => Image::getSize('medium')));
|
||||
'mediumSize' => Image::getSize('medium'),
|
||||
));
|
||||
return $this->display(__FILE__, 'blockbestsellers.tpl');
|
||||
}
|
||||
|
||||
@@ -128,6 +132,31 @@ class BlockBestSellers extends Module
|
||||
$context = Context::getContext();
|
||||
$context->controller->addCSS(($this->_path).'blockbestsellers.css', 'all');
|
||||
}
|
||||
|
||||
public function hookHome($params)
|
||||
{
|
||||
if (Configuration::get('PS_CATALOG_MODE'))
|
||||
return ;
|
||||
|
||||
global $smarty;
|
||||
$currency = new Currency((int)($params['cookie']->id_currency));
|
||||
$bestsellers = ProductSale::getBestSalesLight((int)($params['cookie']->id_lang), 0, 4);
|
||||
if (!$bestsellers AND !Configuration::get('PS_BLOCK_BESTSELLERS_DISPLAY'))
|
||||
return;
|
||||
$best_sellers = array();
|
||||
|
||||
if($bestsellers)
|
||||
foreach ($bestsellers AS $bestseller)
|
||||
{
|
||||
$bestseller['price'] = Tools::displayPrice(Product::getPriceStatic((int)($bestseller['id_product'])), $currency);
|
||||
$best_sellers[] = $bestseller;
|
||||
}
|
||||
|
||||
$smarty->assign(array(
|
||||
'best_sellers' => $best_sellers,
|
||||
'homeSize' => Image::getSize('home')));
|
||||
return $this->display(__FILE__, 'blockbestsellers-home.tpl');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user