// Normalize + use $this->smarty instead of $this->context->smarty in modules

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11944 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rMalie
2011-12-30 14:59:57 +00:00
parent 9033c9c294
commit 58433f1881
27 changed files with 87 additions and 86 deletions
@@ -113,7 +113,7 @@ class BlockBestSellers extends Module
$best_sellers[] = $bestseller;
}
$this->context->smarty->assign(array(
$this->smarty->assign(array(
'best_sellers' => $best_sellers,
'mediumSize' => Image::getSize('medium'),
'smallSize' => Image::getSize('small')
@@ -138,20 +138,20 @@ class BlockBestSellers extends Module
if (Configuration::get('PS_CATALOG_MODE'))
return ;
$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'))
$currency = new Currency($params['cookie']->id_currency);
$bestsellers = ProductSale::getBestSalesLight((int)$params['cookie']->id_lang, 0, 4);
if (!$bestsellers && !Configuration::get('PS_BLOCK_BESTSELLERS_DISPLAY'))
return;
$best_sellers = array();
if($bestsellers)
if ($bestsellers)
foreach ($bestsellers AS $bestseller)
{
$bestseller['price'] = Tools::displayPrice(Product::getPriceStatic((int)($bestseller['id_product'])), $currency);
$best_sellers[] = $bestseller;
}
$this->context->smarty->assign(array(
$this->smarty->assign(array(
'best_sellers' => $best_sellers,
'homeSize' => Image::getSize('home')));
return $this->display(__FILE__, 'blockbestsellers-home.tpl');