diff --git a/controllers/admin/AdminStatsTabController.php b/controllers/admin/AdminStatsTabController.php index 96ed25d9c..86af398ed 100644 --- a/controllers/admin/AdminStatsTabController.php +++ b/controllers/admin/AdminStatsTabController.php @@ -103,7 +103,7 @@ abstract class AdminStatsTabControllerCore extends AdminPreferencesControllerCor $action .= ($identifier && $id ? '&'.Tools::safeOutput($identifier).'='.(int)$id : ''); $module = Tools::getValue('module'); $action .= ($module ? '&module='.Tools::safeOutput($module) : ''); - $action .= ($id_product = Tools::getValue('id_product') ? '&id_product='.Tools::safeOutput($id_product) : ''); + $action .= (($id_product = Tools::getValue('id_product')) ? '&id_product='.Tools::safeOutput($id_product) : ''); $tpl->assign(array( 'current' => self::$currentIndex, 'token' => $token, diff --git a/modules/statsbestproducts/statsbestproducts.php b/modules/statsbestproducts/statsbestproducts.php index 5ff4d8ed2..3474cc052 100644 --- a/modules/statsbestproducts/statsbestproducts.php +++ b/modules/statsbestproducts/statsbestproducts.php @@ -57,13 +57,13 @@ class StatsBestProducts extends ModuleGrid 'id' => 'reference', 'header' => $this->l('Ref.'), 'dataIndex' => 'reference', - 'align' => 'center' + 'align' => 'left' ), array( 'id' => 'name', 'header' => $this->l('Name'), 'dataIndex' => 'name', - 'align' => 'center' + 'align' => 'left' ), array( 'id' => 'totalQuantitySold', @@ -75,13 +75,13 @@ class StatsBestProducts extends ModuleGrid 'id' => 'avgPriceSold', 'header' => $this->l('Price sold'), 'dataIndex' => 'avgPriceSold', - 'align' => 'center' + 'align' => 'right' ), array( 'id' => 'totalPriceSold', 'header' => $this->l('Sales'), 'dataIndex' => 'totalPriceSold', - 'align' => 'center' + 'align' => 'right' ), array( 'id' => 'averageQuantitySold', @@ -103,7 +103,7 @@ class StatsBestProducts extends ModuleGrid ) ); - $this->displayName = $this->l('Best-selling products.'); + $this->displayName = $this->l('Best-selling products'); $this->description = $this->l('A list of the best-selling products.'); } @@ -140,6 +140,7 @@ class StatsBestProducts extends ModuleGrid public function getData() { + $currency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT')); $dateBetween = $this->getDate(); $arrayDateBetween = explode(' AND ', $dateBetween); @@ -178,7 +179,13 @@ class StatsBestProducts extends ModuleGrid if (($this->_start === 0 || Validate::IsUnsignedInt($this->_start)) && Validate::IsUnsignedInt($this->_limit)) $this->_query .= ' LIMIT '.$this->_start.', '.($this->_limit); - $this->_values = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($this->_query); + $values = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($this->_query); + foreach ($values as &$value) + { + $value['avgPriceSold'] = Tools::displayPrice($value['avgPriceSold'], $currency); + $value['totalPriceSold'] = Tools::displayPrice($value['totalPriceSold'], $currency); + } + $this->_values = $values; $this->_totalCount = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('SELECT FOUND_ROWS()'); } } diff --git a/modules/statsbestvouchers/statsbestvouchers.php b/modules/statsbestvouchers/statsbestvouchers.php index 5b78edc52..833c75618 100644 --- a/modules/statsbestvouchers/statsbestvouchers.php +++ b/modules/statsbestvouchers/statsbestvouchers.php @@ -57,19 +57,19 @@ class StatsBestVouchers extends ModuleGrid 'id' => 'code', 'header' => $this->l('Code'), 'dataIndex' => 'code', - 'align' => 'center' + 'align' => 'left' ), array( 'id' => 'name', 'header' => $this->l('Name'), 'dataIndex' => 'name', - 'align' => 'center' + 'align' => 'left' ), array( 'id' => 'ca', 'header' => $this->l('Sales'), 'dataIndex' => 'ca', - 'align' => 'center' + 'align' => 'right' ), array( 'id' => 'total', @@ -116,6 +116,7 @@ class StatsBestVouchers extends ModuleGrid public function getData() { + $currency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT')); $this->_query = 'SELECT SQL_CALC_FOUND_ROWS cr.code, ocr.name, COUNT(ocr.id_cart_rule) as total, ROUND(SUM(o.total_paid_real) / o.conversion_rate,2) as ca FROM '._DB_PREFIX_.'order_cart_rule ocr LEFT JOIN '._DB_PREFIX_.'orders o ON o.id_order = ocr.id_order @@ -133,7 +134,10 @@ class StatsBestVouchers extends ModuleGrid if (($this->_start === 0 || Validate::IsUnsignedInt($this->_start)) && Validate::IsUnsignedInt($this->_limit)) $this->_query .= ' LIMIT '.$this->_start.', '.($this->_limit); - $this->_values = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($this->_query); + $values = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($this->_query); + foreach ($values as &$value) + $value['ca'] = Tools::displayPrice($value['ca'], $currency); + $this->_values = $values; $this->_totalCount = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('SELECT FOUND_ROWS()'); } } diff --git a/modules/statscheckup/statscheckup.php b/modules/statscheckup/statscheckup.php index e58c06779..605f1839a 100644 --- a/modules/statscheckup/statscheckup.php +++ b/modules/statscheckup/statscheckup.php @@ -48,14 +48,14 @@ class StatsCheckUp extends Module public function install() { $confs = array( - 'CHECKUP_DESCRIPTIONS_LT'=>100, - 'CHECKUP_DESCRIPTIONS_GT'=>400, - 'CHECKUP_IMAGES_LT'=>1, - 'CHECKUP_IMAGES_GT'=>2, - 'CHECKUP_SALES_LT'=>1, - 'CHECKUP_SALES_GT'=>2, - 'CHECKUP_STOCK_LT'=>1, - 'CHECKUP_STOCK_GT'=>3 + 'CHECKUP_DESCRIPTIONS_LT' => 100, + 'CHECKUP_DESCRIPTIONS_GT' => 400, + 'CHECKUP_IMAGES_LT' => 1, + 'CHECKUP_IMAGES_GT' => 2, + 'CHECKUP_SALES_LT' => 1, + 'CHECKUP_SALES_GT' => 2, + 'CHECKUP_STOCK_LT' => 1, + 'CHECKUP_STOCK_GT' => 3 ); foreach ($confs as $confname => $confdefault) if (!Configuration::get($confname)) @@ -213,6 +213,7 @@ class StatsCheckUp extends Module +
| '.$arrayColors[$totals['average']].' |