// Normalize

This commit is contained in:
rMalie
2012-01-26 14:44:24 +00:00
parent 96a58849a2
commit c280253f23
5 changed files with 68 additions and 76 deletions
+12 -12
View File
@@ -52,10 +52,10 @@ class BlockBestSellers extends Module
*/
public function install()
{
if (!parent::install() OR
!$this->registerHook('rightColumn') OR
!$this->registerHook('header') OR
!$this->registerHook('updateOrderStatus') OR
if (!parent::install() ||
!$this->registerHook('rightColumn') ||
!$this->registerHook('header') ||
!$this->registerHook('updateOrderStatus') ||
!ProductSale::fillProductSales())
return false;
return true;
@@ -97,17 +97,17 @@ class BlockBestSellers extends Module
public function hookRightColumn($params)
{
if (Configuration::get('PS_CATALOG_MODE'))
return ;
return;
$currency = new Currency((int)($params['cookie']->id_currency));
$currency = new Currency($params['cookie']->id_currency);
$bestsellers = ProductSale::getBestSalesLight((int)($params['cookie']->id_lang), 0, 5);
if (!$bestsellers AND !Configuration::get('PS_BLOCK_BESTSELLERS_DISPLAY'))
if (!$bestsellers && !Configuration::get('PS_BLOCK_BESTSELLERS_DISPLAY'))
return;
$best_sellers = array();
if($bestsellers)
foreach ($bestsellers AS $bestseller)
if ($bestsellers)
foreach ($bestsellers as $bestseller)
{
$bestseller['price'] = Tools::displayPrice(Product::getPriceStatic((int)($bestseller['id_product'])), $currency);
$best_sellers[] = $bestseller;
@@ -129,14 +129,14 @@ class BlockBestSellers extends Module
public function hookHeader($params)
{
if (Configuration::get('PS_CATALOG_MODE'))
return ;
return;
$this->context->controller->addCSS(($this->_path).'blockbestsellers.css', 'all');
}
public function hookHome($params)
{
if (Configuration::get('PS_CATALOG_MODE'))
return ;
return;
$currency = new Currency($params['cookie']->id_currency);
$bestsellers = ProductSale::getBestSalesLight((int)$params['cookie']->id_lang, 0, 4);
@@ -145,7 +145,7 @@ class BlockBestSellers extends Module
$best_sellers = array();
if ($bestsellers)
foreach ($bestsellers AS $bestseller)
foreach ($bestsellers as $bestseller)
{
$bestseller['price'] = Tools::displayPrice(Product::getPriceStatic((int)($bestseller['id_product'])), $currency);
$best_sellers[] = $bestseller;