From bdb797a66cd631e234be9cdb820127fabe888b2a Mon Sep 17 00:00:00 2001 From: Sarah Lorenzini Date: Tue, 17 Sep 2013 17:48:43 +0200 Subject: [PATCH] // update tabs stats --- modules/gridhtml/gridhtml.php | 31 +-- modules/pagesnotfound/pagesnotfound.php | 78 ++++--- modules/sekeywords/sekeywords.php | 83 ++++--- .../statsbestcategories.php | 21 +- .../statsbestcustomers/statsbestcustomers.php | 56 ++--- .../statsbestproducts/statsbestproducts.php | 33 ++- .../statsbestsuppliers/statsbestsuppliers.php | 18 +- .../statsbestvouchers/statsbestvouchers.php | 21 +- modules/statscarrier/statscarrier.php | 43 +++- modules/statscatalog/statscatalog.php | 112 ++++++---- modules/statscheckup/statscheckup.php | 206 ++++++++++-------- modules/statsequipment/statsequipment.php | 66 ++++-- modules/statsnewsletter/statsnewsletter.php | 27 ++- modules/statsorigin/statsorigin.php | 73 ++++--- .../statspersonalinfos/statspersonalinfos.php | 127 ++++++++--- modules/statsproduct/statsproduct.php | 4 +- modules/statssearch/statssearch.php | 37 ++-- modules/statsstock/statsstock.php | 113 +++++----- 18 files changed, 691 insertions(+), 458 deletions(-) diff --git a/modules/gridhtml/gridhtml.php b/modules/gridhtml/gridhtml.php index af2709bc9..a8edcc25d 100644 --- a/modules/gridhtml/gridhtml.php +++ b/modules/gridhtml/gridhtml.php @@ -62,19 +62,24 @@ class GridHtml extends ModuleGridEngine if (!isset($params['emptyMsg'])) $params['emptyMsg'] = 'Empty'; - $html = '
- '; - foreach ($params['columns'] as $column) - $html .= ''; - $html .= ' + $html = ' +
- '.$column['header'].'
- - -
+ + '; + foreach ($params['columns'] as $column) + $html .= ''; + $html .= ' + + - + + + + +
+ '.$column['header'].' +
-
-

'.$this->displayName.'

-
-
- - -
+
+ '.$this->displayName.'
- - '.$this->returnLine($this->l('Products available:'), (int)$total).' - '.$this->returnLine($this->l('Average price (base price):'), Tools::displayPrice($averagePrice, $this->context->currency)).' - '.$this->returnLine($this->l('Product pages viewed:'), (int)$totalPageViewed).' - '.$this->returnLine($this->l('Products bought:'), (int)$totalBought).' - '.$this->returnLine($this->l('Average number of page visits:'), number_format((float)$averageViewed, 2, '.', '')).' - '.$this->returnLine($this->l('Average number of purchases:'), number_format((float)$averagePurchase, 2, '.', '')).' - '.$this->returnLine($this->l('Images available:'), (int)$totalPictures).' - '.$this->returnLine($this->l('Average number of images:'), number_format((float)$averagePictures, 2, '.', '')).' - '.$this->returnLine($this->l('Products never viewed:'), (int)$totalNV.' / '.(int)$total).' - '.$this->returnLine(''.$this->l('Products never purchased:').'', (int)$totalNB.' / '.(int)$total).' - '.$this->returnLine($this->l('Conversion rate*:'), $conversion).' -
-
- * - '.$this->l('Define the average conversion rate for the product page (It is possible to purchase a product without viewing the product page, so this rate can be greater than 1).').' -
-
'; +
+
+ +
+ +
+
+
+ +
+

+ '.$this->l('Define the average conversion rate for the product page (It is possible to purchase a product without viewing the product page, so this rate can be greater than 1).').' +

+
'; if (count($productsNB) && count($productsNB) < 50) { - $html .= '
-

'.$this->l('Products never purchased').'

- - '; + $html .= ' +
'.$this->l('Products never purchased').'
+
'.$this->l('ID').''.$this->l('Name').''.$this->l('Edit / View').'
+ + + + + + + + '; foreach ($productsNB as $product) $html .= ' - - + '; $html .= ' -
'.$this->l('ID').''.$this->l('Name').''.$this->l('Edit / View').'
'.$product['id_product'].''.$product['name'].' - - + '.$product['name'].' +
-
'; + + '; } return $html; } private function returnLine($label, $data) { - return ''.$label.''.$data.''; + return ''.$label.''.$data.''; } } \ No newline at end of file diff --git a/modules/statscheckup/statscheckup.php b/modules/statscheckup/statscheckup.php index 78fef97d8..e58c06779 100644 --- a/modules/statscheckup/statscheckup.php +++ b/modules/statscheckup/statscheckup.php @@ -155,61 +155,80 @@ class StatsCheckUp extends Module ); $this->html = ' - -
-
- - - - - - '; - foreach ($arrayConf as $conf => $translations) - $this->html .= ' - - - - '; - $this->html .= '
'.$arrayColors[0].' '.$this->l('Not enough').''.$arrayColors[2].' '.$this->l('Alright').'
'.$translations['name'].''.$this->l('Less than').' - '.$translations['text'].' - '.$this->l('Greater than').' - '.$translations['text'].' -
-
-
+
' + .$this->displayName.'
-
-
-
- '.$this->l('Order by').' - + + + + + + + + + '; + foreach ($arrayConf as $conf => $translations) + $this->html .= ' + + + + + + + '; + $this->html .= '
'.$arrayColors[0].' '.$this->l('Not enough').''.$arrayColors[2].' '.$this->l('Alright').'
+ + +
+
+ '.$this->l('Less than').' + + '.$translations['text'].' +
+
+
+
+
+ '.$this->l('Greater than').' + + '.$translations['text'].' +
+
+
+
-
- - - - - '; - foreach ($languages as $language) - $this->html .= ''; - $this->html .= ' - - - - - '; + +
+
+ +
+ +
+
+
+ +
'.$this->l('ID').''.$this->l('Item').''.$this->l('Active').''.$this->l('Desc.').' ('.strtoupper($language['iso_code']).')'.$this->l('Images').''.$this->l('Sales').''.$this->l('Available quantity for sale').''.$this->l('Global').'
+ + + + + '; + foreach ($languages as $language) + $this->html .= ''; + $this->html .= ' + + + + + + + '; foreach ($result as $row) { $totals['products']++; @@ -238,23 +257,26 @@ class StatsCheckUp extends Module $scores['average'] = array_sum($scores) / $divisor; $scores['average'] = ($scores['average'] < 1 ? 0 : ($scores['average'] > 1.5 ? 2 : 1)); - $this->html .= ' - - - '; - foreach ($languages as $language) - if (isset($row['desclength_'.$language['iso_code']])) - $this->html .= ''; - else - $this->html .= ''; $this->html .= ' - - - - - '; + + + + '; + foreach ($languages as $language) + if (isset($row['desclength_'.$language['iso_code']])) + $this->html .= ''; + else + $this->html .= ''; + $this->html .= ' + + + + + '; } + $this->html .= ''; + $totals['active'] = $totals['active'] / $totals['products']; $totals['active'] = ($totals['active'] < 1 ? 0 : ($totals['active'] > 1.5 ? 2 : 1)); $totals['images'] = $totals['images'] / $totals['products']; @@ -272,31 +294,31 @@ class StatsCheckUp extends Module $totals['average'] = ($totals['average'] < 1 ? 0 : ($totals['average'] > 1.5 ? 2 : 1)); $this->html .= ' - - - '; - foreach ($languages as $language) - $this->html .= ''; - $this->html .= ' - - - - - - - - '; - foreach ($languages as $language) - $this->html .= ''; - $this->html .= ' - - - - - -
'.$this->l('ID').''.$this->l('Item').''.$this->l('Active').''.$this->l('Desc.').' ('.strtoupper($language['iso_code']).')'.$this->l('Images').''.$this->l('Sales').''.$this->l('Available quantity for sale').''.$this->l('Global').'
'.$row['id_product'].''.Tools::substr($row['name'], 0, 42).''.$arrayColors[$scores['active']].''.(int)$row['desclength_'.$language['iso_code']].' '.$arrayColors[$scores['description_'.$language['iso_code']]].'0 '.$arrayColors[0].''.(int)$row['nbImages'].' '.$arrayColors[$scores['images']].''.(int)$row['nbSales'].' '.$arrayColors[$scores['sales']].''.(int)$row['stock'].' '.$arrayColors[$scores['stock']].''.$arrayColors[$scores['average']].'
'.$row['id_product'].''.Tools::substr($row['name'], 0, 42).''.$arrayColors[$scores['active']].''.(int)$row['desclength_'.$language['iso_code']].' '.$arrayColors[$scores['description_'.$language['iso_code']]].'0 '.$arrayColors[0].''.(int)$row['nbImages'].' '.$arrayColors[$scores['images']].''.(int)$row['nbSales'].' '.$arrayColors[$scores['sales']].''.(int)$row['stock'].' '.$arrayColors[$scores['stock']].''.$arrayColors[$scores['average']].'
'.$this->l('Active').''.$this->l('Desc.').' ('.strtoupper($language['iso_code']).')'.$this->l('Images').''.$this->l('Sales').''.$this->l('Available quantity for sale').''.$this->l('Global').'
'.$arrayColors[$totals['active']].''.$arrayColors[$totals['description_'.$language['iso_code']]].''.$arrayColors[$totals['images']].''.$arrayColors[$totals['sales']].''.$arrayColors[$totals['stock']].''.$arrayColors[$totals['average']].'
-
-
 
'; + + + + '.$this->l('Active').''; + foreach ($languages as $language) + $this->html .= ''.$this->l('Desc.').' ('.strtoupper($language['iso_code']).')'; + $this->html .= ' + '.$this->l('Images').' + '.$this->l('Sales').' + '.$this->l('Available quantity for sale').' + '.$this->l('Global').' + + + + '.$arrayColors[$totals['active']].''; + foreach ($languages as $language) + $this->html .= ''.$arrayColors[$totals['description_'.$language['iso_code']]].''; + $this->html .= ' + '.$arrayColors[$totals['images']].' + '.$arrayColors[$totals['sales']].' + '.$arrayColors[$totals['stock']].' + '.$arrayColors[$totals['average']].' + + + '; return $this->html; } diff --git a/modules/statsequipment/statsequipment.php b/modules/statsequipment/statsequipment.php index 2d586d01d..5e3aed949 100644 --- a/modules/statsequipment/statsequipment.php +++ b/modules/statsequipment/statsequipment.php @@ -121,35 +121,55 @@ class StatsEquipment extends ModuleGraph $equipment = $this->getEquipment(); $this->html = ' -

'.$this->displayName.'

-

'.$this->l('Determine the percentage of web browsers used by customers.').'

- '.$this->engine(array('type' => 'pie', 'option' => 'wb')).'

-

'.$this->l('CSV Export').'

-

'.$this->l('Determine the percentage of operating systems used by customers.').'

- '.$this->engine(array('type' => 'pie', 'option' => 'os')).' -

'.$this->l('CSV Export').'

'; - +
' + .$this->displayName.' +
+

'.$this->l('Guide').'

+
+

'.$this->l('Ensure that your website is accessible to all.').'

+

+ '.$this->l('When managing Websites, it is important to keep track of software used by visitors in order to be sure that the site displays the same way for everyone. + PrestaShop was built in order to be compatible with most recent Web browsers and computer operating systems (OS). + However, because you may end up adding advanced features to your Website or even modify the core PrestaShop code, these additions may not be accessible by everyone. + That is why it is a good idea to keep tabs on the percentage of users for each type of software before adding or changing something that only a limited number of users will be able to access.').' +

+
+
+
+
+ '.$this->engine(array('type' => 'pie', 'option' => 'wb')).' +
+
+

'.$this->l('Determine the percentage of web browsers used by customers.').'

+
+ + '.$this->l('CSV Export').' + +
+
+
+
+
+
+ '.$this->engine(array('type' => 'pie', 'option' => 'os')).' +
+
+

'.$this->l('Determine the percentage of operating systems used by customers.').'

+
+ + '.$this->l('CSV Export').' + +
+
+
'; if ($equipment) { - $this->html .= ' - '; + $this->html .= '
'.$this->l('Plugins').'
+ '; foreach ($equipment as $name => $value) $this->html .= ''; $this->html .= '
'.$this->l('Plugins').'
'.$name.''.number_format(100 * $value, 2).'%
'; } - $this->html .= ' -
-
-

'.$this->l('Guide').'

-

'.$this->l('Ensure that your website is accessible to all.').'

-

- '.$this->l('When managing Websites, it is important to keep track of software used by visitors in order to be sure that the site displays the same way for everyone. - PrestaShop was built in order to be compatible with most recent Web browsers and computer operating systems (OS). - However, because you may end up adding advanced features to your Website or even modify the core PrestaShop code, these additions may not be accessible by everyone. - That is why it is a good idea to keep tabs on the percentage of users for each type of software before adding or changing something that only a limited number of users will be able to access.').' -


- -
'; return $this->html; } diff --git a/modules/statsnewsletter/statsnewsletter.php b/modules/statsnewsletter/statsnewsletter.php index 9f9ba5c77..3441b8c71 100644 --- a/modules/statsnewsletter/statsnewsletter.php +++ b/modules/statsnewsletter/statsnewsletter.php @@ -61,13 +61,26 @@ class StatsNewsletter extends ModuleGraph if (Tools::getValue('export')) $this->csvExport(array('type' => 'line', 'layers' => 3)); $this->_html = ' -
-

'.$this->displayName.'

-

'.$this->l('Customer registrations:').' '.(int)$totals['customers'].'

-

'.$this->l('Visitor registrations: ').' '.(int)$totals['visitors'].'

-

'.$this->l('Both:').' '.(int)$totals['both'].'

-
'.$this->engine(array('type' => 'line', 'layers' => 3)).'
-

'.$this->l('CSV Export').'

+
+ '.$this->displayName.' +
+
+
+
+ '.$this->engine(array('type' => 'line', 'layers' => 3)).' +
+
+
    +
  • '.$this->l('Customer registrations:').' '.(int)$totals['customers'].'
  • +
  • '.$this->l('Visitor registrations: ').' '.(int)$totals['visitors'].'
  • +
  • '.$this->l('Both:').' '.(int)$totals['both'].'
  • +
+
+ + '.$this->l('CSV Export').' + +
+
'; } else diff --git a/modules/statsorigin/statsorigin.php b/modules/statsorigin/statsorigin.php index 0f788641c..87997486f 100644 --- a/modules/statsorigin/statsorigin.php +++ b/modules/statsorigin/statsorigin.php @@ -83,40 +83,57 @@ class StatsOrigin extends ModuleGraph if (Tools::getValue('export')) if (Tools::getValue('exportType') == 'top') $this->csvExport(array('type' => 'pie')); - $this->_html = '

'.$this->l('Origin').'

'; + $this->_html = '
'.$this->l('Origin').'
'; if (count($websites)) { $this->_html .= ' -

'.$this->l('Here we break down the 10 most popular referral websites that call customers to your e-store.').'

-
'.$this->engine(array('type' => 'pie')).'

-

'.$this->l('CSV Export').'


- - - - - - '; +
+ '.$this->l('Here we break down the 10 most popular referral websites that call customers to your e-store.').' +
+

'.$this->l('Guide').'

+
+

'.$this->l('What is a referral website?').'

+

+ '.$this->l('When visiting a webpage, the referrer is the URL of the previous webpage from which a link was followed.').'
+ '.$this->l('A referrer enables you to know which keywords visitors use in search engines when browsing for your online store.').'

+ '.$this->l('A referrer can be:').' +

+
    +
  • '.$this->l('Someone who posts a link to your shop.').'
  • +
  • '.$this->l('A partner who has agreed to a link exchange in order to attract new customers.').'
  • +
+
+
+
+
+ '.$this->engine(array('type' => 'pie')).' +
+ +
+
+
'.$this->l('Origin').''.$this->l('Total').'
+ + + + + + + '; foreach ($websites as $website => $total) - $this->_html .= ' - - '; - $this->_html .= '
'.$this->l('Origin').''.$this->l('Total').'
'.(!strstr($website, ' ') ? '' : '').$website.(!strstr($website, ' ') ? '' : '').''.$total.'
'; + $this->_html .= ' + + '.(!strstr($website, ' ') ? '' : '').$website.(!strstr($website, ' ') ? '' : '').''.$total.' + '; + $this->_html .= ' + + '; } else - $this->_html .= '

'.$this->l('Direct links only').'

'; - $this->_html .= '

-

'.$this->l('Guide').'

-

'.$this->l('What is a referral website?').'

-

- '.$this->l('When visiting a webpage, the referrer is the URL of the previous webpage from which a link was followed.').'
- '.$this->l('A referrer enables you to know which keywords visitors use in search engines when browsing for your online store.').'

- '.$this->l('A referrer can be:').' -

    -
  • '.$this->l('Someone who posts a link to your shop.').'
  • -
  • '.$this->l('A partner who has agreed to a link exchange in order to attract new customers.').'
  • -
-

-
'; + $this->_html .= '

'.$this->l('Direct links only').'

'; return $this->_html; } diff --git a/modules/statspersonalinfos/statspersonalinfos.php b/modules/statspersonalinfos/statspersonalinfos.php index 70de7f1e3..e24ebb4c0 100644 --- a/modules/statspersonalinfos/statspersonalinfos.php +++ b/modules/statspersonalinfos/statspersonalinfos.php @@ -54,7 +54,27 @@ class StatsPersonalInfos extends ModuleGraph public function hookAdminStatsModules($params) { - $this->html = '

'.$this->displayName.'

'; + $this->html = ' +
+ '.$this->displayName.' +
+

'.$this->l('Guide').'

+
+

'.$this->l('Target your audience.').'

+

+ '.$this->l('In order for each message to have an impact, you need to know who it is being addressed to. ').' + '.$this->l('Defining your target audience is essential when choosing the right tools to win them over.').' + '.$this->l('It is best to limit action to a group -- or groups -- of clients.').' + '.$this->l('Storing registered customer information allows you to accurately define customer profile so you can adapt your special deals and promotions.').' +

+

+ '.$this->l('Increase your sales by').' +

    +
  • '.$this->l('launching targeted advertisement campaigns.').'
  • +
  • '.$this->l('Contact a group of clients by email or newsletter.').'
  • +
+

+
'; if (count(Customer::getCustomers())) { if (Tools::getValue('export')) @@ -70,44 +90,79 @@ class StatsPersonalInfos extends ModuleGraph $this->csvExport(array('type' => 'pie', 'option' => 'language')); $this->html .= ' -

'.$this->l('Gender distribution allows you to determine the percentage of men and women shoppers in your store. ').'

-
'.$this->engine(array('type' => 'pie', 'option' => 'gender')).'

-

'.$this->l('CSV Export').'

-

-

'.$this->l('Age ranges allow you to better understand target demographics. ').'

-
'.$this->engine(array('type' => 'pie', 'option' => 'age')).'

-

'.$this->l('CSV Export').'



-

'.$this->l('Country distribution allows you to analyze which part of the world your customers are shopping from.').'

-
'.$this->engine(array('type' => 'pie', 'option' => 'country')).'

-

'.$this->l('CSV Export').'



-

'.$this->l('Currency range allows you to determine which currency your customers are using.').'

-
'.$this->engine(array('type' => 'pie', 'option' => 'currency')).'

-

'.$this->l('CSV Export').'



-

'.$this->l('Language distribution allows you to analyze the browsing language used by your customers. ').'

-
'.$this->engine(array('type' => 'pie', 'option' => 'language')).'

-

'.$this->l('CSV Export').'

- '; +
+
+
+ '.$this->engine(array('type' => 'pie', 'option' => 'gender')).' +
+
+

'.$this->l('Gender distribution allows you to determine the percentage of men and women shoppers in your store. ').'

+
+ + '.$this->l('CSV Export').' + +
+
+
+
+
+
+ '.$this->engine(array('type' => 'pie', 'option' => 'age')).' +
+
+

'.$this->l('Age ranges allow you to better understand target demographics. ').'

+
+ + '.$this->l('CSV Export').' + +
+
+
+
+
+
+ '.$this->engine(array('type' => 'pie', 'option' => 'country')).' +
+
+

'.$this->l('Country distribution allows you to analyze which part of the world your customers are shopping from.').'

+
+ + '.$this->l('CSV Export').' + +
+
+
+
+
+
+ '.$this->engine(array('type' => 'pie', 'option' => 'currency')).' +
+
+

'.$this->l('Currency range allows you to determine which currency your customers are using.').'

+
+ + '.$this->l('CSV Export').' + +
+
+
+
+
+
+ '.$this->engine(array('type' => 'pie', 'option' => 'language')).' +
+
+

'.$this->l('Language distribution allows you to analyze the browsing language used by your customers. ').'

+
+ + '.$this->l('CSV Export').' + +
+
+
'; } else $this->html .= '

'.$this->l('No customers have registered yet.').'

'; - $this->html .= ' -

-

'.$this->l('Guide').'

-

'.$this->l('Target your audience.').'

-

- '.$this->l('In order for each message to have an impact, you need to know who it is being addressed to. ').' - '.$this->l('Defining your target audience is essential when choosing the right tools to win them over.').' - '.$this->l('It is best to limit action to a group -- or groups -- of clients.').' - '.$this->l('Storing registered customer information allows you to accurately define customer profile so you can adapt your special deals and promotions.').' -


-

- '.$this->l('Increase your sales by').' -

    -
  • '.$this->l('launching targeted advertisement campaigns.').'
  • -
  • '.$this->l('Contact a group of clients by email or newsletter.').'
  • -
-


-
'; return $this->html; } diff --git a/modules/statsproduct/statsproduct.php b/modules/statsproduct/statsproduct.php index 903506852..6c57748b1 100644 --- a/modules/statsproduct/statsproduct.php +++ b/modules/statsproduct/statsproduct.php @@ -184,7 +184,7 @@ class StatsProduct extends ModuleGraph $totalSales = $this->getTotalSales($product->id); $totalViewed = $this->getTotalViewed($product->id); $this->html .= '

'.$product->name.' - '.$this->l('Details').'

-
+
'.$this->engine(array('layers' => 2, 'type' => 'line', 'option' => '1-'.$id_product)).' @@ -292,7 +292,7 @@ class StatsProduct extends ModuleGraph $categories = Category::getCategories((int)$this->context->language->id, true, false); $this->html .= '
-
+