From a25cc16f28c924867940bb3e3803917d8c3eddef Mon Sep 17 00:00:00 2001 From: rGaillard Date: Sat, 19 Nov 2011 15:03:20 +0000 Subject: [PATCH] // Module configuration is now displayed git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10289 b9a71923-0436-4b27-9f14-aed3839534dd --- classes/AdminController.php | 10 +++++----- classes/Product.php | 2 +- controllers/admin/AdminModulesController.php | 1 + modules/blockbestsellers/blockbestsellers.php | 13 +++++++------ 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/classes/AdminController.php b/classes/AdminController.php index 6342e3ff9..945e714f9 100644 --- a/classes/AdminController.php +++ b/classes/AdminController.php @@ -1552,9 +1552,8 @@ class AdminControllerCore extends Controller unset($parse_query['setShopContext']); $this->redirect_after = $url['path'].'?'.http_build_query($parse_query); } - else if (!Shop::isFeatureActive()) + elseif (!Shop::isFeatureActive()) $this->context->cookie->shopContext = 's-1'; - $shop_id = ''; if ($this->context->cookie->shopContext) { @@ -1562,12 +1561,13 @@ class AdminControllerCore extends Controller if (count($split) == 2 && $split[0] == 's') $shop_id = (int)$split[1]; } - else if ($this->context->employee->id_profile == _PS_ADMIN_PROFILE_) + elseif ($this->context->employee->id_profile == _PS_ADMIN_PROFILE_) $shop_id = ''; - else if ($this->context->shop->getTotalShopsWhoExists() != Employee::getTotalEmployeeShopById((int)$this->context->employee->id)) + elseif ($this->context->shop->getTotalShopsWhoExists() != Employee::getTotalEmployeeShopById((int)$this->context->employee->id)) { $shops = Employee::getEmployeeShopById((int)$this->context->employee->id); - $shop_id = (int)$shops[0]; + if (count($shops)) + $shop_id = (int)$shops[0]; } else Employee::getEmployeeShopAccess((int)$this->context->employee->id); diff --git a/classes/Product.php b/classes/Product.php index ead14ffc3..531e601e4 100644 --- a/classes/Product.php +++ b/classes/Product.php @@ -2030,7 +2030,7 @@ class ProductCore extends ObjectModel '-'.$quantity.'-'.$product_attribute_label.'-'.($use_tax?'1':'0').'-'.$decimals.'-'.($only_reduc?'1':'0').'-'.($use_reduc?'1':'0').'-'.$with_ecotax; // reference parameter is filled before any returns - $specific_price = SpecificPrice::getSpecificPrice((int)($id_product), $id_shop, $id_currency, $id_country, $id_group, $quantity, $id_product_attribute); + $specific_price = SpecificPrice::getSpecificPrice((int)$id_product, $id_shop, $id_currency, $id_country, $id_group, $quantity, $id_product_attribute); if (isset(self::$_prices[$cacheId])) return self::$_prices[$cacheId]; diff --git a/controllers/admin/AdminModulesController.php b/controllers/admin/AdminModulesController.php index 732b65db7..efa13545c 100644 --- a/controllers/admin/AdminModulesController.php +++ b/controllers/admin/AdminModulesController.php @@ -520,6 +520,7 @@ class AdminModulesControllerCore extends AdminController Context::getContext()->shop = clone(Context::getContext()->tmpOldShop); unset(Context::getContext()->tmpOldShop); } + $this->context->smarty->assign('module_content', $toolbar.'
 
'.$echo.'
 
'.$toolbar); } elseif($echo) $return = ($method == 'install' ? 12 : 13); diff --git a/modules/blockbestsellers/blockbestsellers.php b/modules/blockbestsellers/blockbestsellers.php index d0ef523f7..e204bf5d2 100644 --- a/modules/blockbestsellers/blockbestsellers.php +++ b/modules/blockbestsellers/blockbestsellers.php @@ -101,16 +101,17 @@ class BlockBestSellers extends Module $currency = new Currency((int)($params['cookie']->id_currency)); $bestsellers = ProductSale::getBestSalesLight((int)($params['cookie']->id_lang), 0, 5); + 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; - } + foreach ($bestsellers AS $bestseller) + { + $bestseller['price'] = Tools::displayPrice(Product::getPriceStatic((int)($bestseller['id_product'])), $currency); + $best_sellers[] = $bestseller; + } $this->context->smarty->assign(array( 'best_sellers' => $best_sellers,