This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 685 B |
Binary file not shown.
|
Before Width: | Height: | Size: 773 B |
@@ -1,11 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<module>
|
||||
<name>statscatalog</name>
|
||||
<displayName>Catalog statistics</displayName>
|
||||
<version>1</version>
|
||||
<description>General statistics about your catalog.</description>
|
||||
<author>PrestaShop</author>
|
||||
<tab>analytics_stats</tab>
|
||||
<is_configurable>0</is_configurable>
|
||||
<need_instance>1</need_instance>
|
||||
</module>
|
||||
@@ -1,26 +0,0 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_cf3aa21c6a2147ddbd86f34091daeccd'] = 'Katalogstatistik';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_226ed1224c5b2db3d3e0716bb4f74da5'] = 'Allgemeine Statistiken über Ihren Katalog';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_85dbdb21fe502c4d7a1e81bca0aa396d'] = 'Kauf';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_233d48e63da77b092da350559d2f8382'] = 'Besuche';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_0173374ac20f5843d58b553d5b226ef6'] = 'Wählen Sie eine Kategorie';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_b1c94ca2fbc3e78fc30069c8d0f01680'] = 'Alle';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_a7b623414d4b6a3225b4e935babec6d2'] = 'Produkte zur Verfügung:';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_1099377f1598a0856e2457a5145d89c2'] = 'Durchschnittlicher Preis (Basispreis):';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_48a93dc02c74f3065af1ba47fca070d0'] = 'Größe und gesehene Seiten:';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_156e5c5872c9af24a5c982da07a883c2'] = 'Gekaufte Produkte:';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_85f179d4142ca061d49605a7fffdc09d'] = 'Durchschnittliche Anzahl an Seitenaufrufen:';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_05ff4bfc3baf0acd31a72f1ac754de04'] = 'Durchschnittliche Anzahl an Einkäufen:';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_c09d09e371989d89847049c9574b6b8e'] = 'Bilder zur Verfügung:';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_65275d1b04037d8c8e42425002110363'] = 'Durchschnittliche Anzahl an Bildern:';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_51b8891d531ad91128ba58c8928322ab'] = 'Nie angesehene Produkte:';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_8725647ef741e5d48c1e6f652ce80b50'] = 'Nie gekaufte Produkte:';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_b86770bc713186bcf43dbb1164c5fd28'] = 'Umwandlungsrate*:';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_64de80ec5f50aefd6ab2b9260a1f4055'] = 'Durchschnittliche Umwandlungsrate für die Produktseite. Man kann ein Produkt kaufen, ohne die Produktseite anzusehen. In dem Fall kann diese Rate größer als 1 sein.';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_58a714d3e9bb2902a5b688c99bd4d8e6'] = 'Nie gekaufte Produkte ';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_b718adec73e04ce3ec720dd11a06a308'] = 'ID';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_49ee3087348e8d44e1feda1917443987'] = 'Name';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_8e7c9a35104a5a68199678bd6bc5d187'] = 'Bearbeiten/ Ansehen';
|
||||
@@ -1,4 +0,0 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
@@ -1,26 +0,0 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_cf3aa21c6a2147ddbd86f34091daeccd'] = 'Catálogo de estadísticas';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_226ed1224c5b2db3d3e0716bb4f74da5'] = 'Estadísticas generales sobre su catálogo';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_85dbdb21fe502c4d7a1e81bca0aa396d'] = 'compras';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_233d48e63da77b092da350559d2f8382'] = 'visitas';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_0173374ac20f5843d58b553d5b226ef6'] = 'Elija una categoría';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_b1c94ca2fbc3e78fc30069c8d0f01680'] = 'todas';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_a7b623414d4b6a3225b4e935babec6d2'] = 'Producto disponibles:';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_1099377f1598a0856e2457a5145d89c2'] = 'Precio medio (precio base):';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_48a93dc02c74f3065af1ba47fca070d0'] = 'Páginas del producto vistas:';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_156e5c5872c9af24a5c982da07a883c2'] = 'Productos comprados:';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_85f179d4142ca061d49605a7fffdc09d'] = 'Número medio de á¡ginas visitadas:';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_05ff4bfc3baf0acd31a72f1ac754de04'] = 'Número medio de compras:';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_c09d09e371989d89847049c9574b6b8e'] = 'Imágenes disponibles:';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_65275d1b04037d8c8e42425002110363'] = 'Número medio de imágenes:';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_51b8891d531ad91128ba58c8928322ab'] = 'Producto nunca vistos:';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_8725647ef741e5d48c1e6f652ce80b50'] = 'Producto no comprados nunca:';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_b86770bc713186bcf43dbb1164c5fd28'] = 'Índice de conversión';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_64de80ec5f50aefd6ab2b9260a1f4055'] = 'Promedio tipo de conversión de la página del producto. Es posible comprar un producto sin ver la página del producto, por lo que esta tasa puede ser mayor que 1.';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_58a714d3e9bb2902a5b688c99bd4d8e6'] = 'Productos nunca comprados';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_b718adec73e04ce3ec720dd11a06a308'] = 'ID';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_49ee3087348e8d44e1feda1917443987'] = 'Nombre';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_8e7c9a35104a5a68199678bd6bc5d187'] = 'Editar/Ver';
|
||||
@@ -1,26 +0,0 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_cf3aa21c6a2147ddbd86f34091daeccd'] = 'Statistiques catalogue';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_226ed1224c5b2db3d3e0716bb4f74da5'] = 'Statistiques générales sur le catalogue';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_85dbdb21fe502c4d7a1e81bca0aa396d'] = 'achat';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_233d48e63da77b092da350559d2f8382'] = 'visites';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_0173374ac20f5843d58b553d5b226ef6'] = 'Choisissez une catégorie';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_b1c94ca2fbc3e78fc30069c8d0f01680'] = 'Toutes';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_a7b623414d4b6a3225b4e935babec6d2'] = 'Produits disponibles :';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_1099377f1598a0856e2457a5145d89c2'] = 'Prix moyen (HT) :';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_48a93dc02c74f3065af1ba47fca070d0'] = 'Pages produit vues :';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_156e5c5872c9af24a5c982da07a883c2'] = 'Produits achetés :';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_85f179d4142ca061d49605a7fffdc09d'] = 'Nombre moyen de visites :';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_05ff4bfc3baf0acd31a72f1ac754de04'] = 'Nombre moyen d\'achats :';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_c09d09e371989d89847049c9574b6b8e'] = 'Images disponibles :';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_65275d1b04037d8c8e42425002110363'] = 'Nombre moyen d\'images :';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_51b8891d531ad91128ba58c8928322ab'] = 'Produits jamais consultés :';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_8725647ef741e5d48c1e6f652ce80b50'] = 'Produits jamais achetés :';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_b86770bc713186bcf43dbb1164c5fd28'] = 'Taux de transformation* :';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_64de80ec5f50aefd6ab2b9260a1f4055'] = 'Taux de transformation moyen pour une page produit. Un produit pouvant être acheté sans passer par sa page dédiée, cet indicateur peut être supérieur à 1.';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_58a714d3e9bb2902a5b688c99bd4d8e6'] = 'Produits jamais achetés';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_b718adec73e04ce3ec720dd11a06a308'] = 'ID';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_49ee3087348e8d44e1feda1917443987'] = 'Nom';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_8e7c9a35104a5a68199678bd6bc5d187'] = 'Editer / Voir';
|
||||
@@ -1,26 +0,0 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_cf3aa21c6a2147ddbd86f34091daeccd'] = 'Catalogo statistiche';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_226ed1224c5b2db3d3e0716bb4f74da5'] = 'Statistiche generali sul tuo catalogo';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_85dbdb21fe502c4d7a1e81bca0aa396d'] = 'acquisto';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_233d48e63da77b092da350559d2f8382'] = 'visite';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_0173374ac20f5843d58b553d5b226ef6'] = 'Scegli una categoria';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_b1c94ca2fbc3e78fc30069c8d0f01680'] = 'Tutto';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_a7b623414d4b6a3225b4e935babec6d2'] = 'Prodotti disponibili:';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_1099377f1598a0856e2457a5145d89c2'] = 'Prezzo medio (prezzo base):';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_48a93dc02c74f3065af1ba47fca070d0'] = 'Pagine viste del prodotto:';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_156e5c5872c9af24a5c982da07a883c2'] = 'I prodotti acquistati:';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_85f179d4142ca061d49605a7fffdc09d'] = 'Numero medio di visite pagina:';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_05ff4bfc3baf0acd31a72f1ac754de04'] = 'Numero medio di acquisti:';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_c09d09e371989d89847049c9574b6b8e'] = 'Immagini disponibili:';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_65275d1b04037d8c8e42425002110363'] = 'Numero medio di immagini:';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_51b8891d531ad91128ba58c8928322ab'] = 'I prodotti mai visti:';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_8725647ef741e5d48c1e6f652ce80b50'] = 'Prodotti mai comprati:';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_b86770bc713186bcf43dbb1164c5fd28'] = 'Tasso di conversione *:';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_64de80ec5f50aefd6ab2b9260a1f4055'] = 'Tasso medio di conversione per la pagina del prodotto. E\' possibile acquistare un prodotto senza visualizzare la pagina del prodotto, quindi questo tasso può essere maggiore di 1.';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_58a714d3e9bb2902a5b688c99bd4d8e6'] = 'Prodotti mai comprati';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_b718adec73e04ce3ec720dd11a06a308'] = 'ID';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_49ee3087348e8d44e1feda1917443987'] = 'Nome';
|
||||
$_MODULE['<{statscatalog}prestashop>statscatalog_8e7c9a35104a5a68199678bd6bc5d187'] = 'Modifica / Visualizza';
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 932 B |
Binary file not shown.
|
Before Width: | Height: | Size: 807 B |
@@ -1,234 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 1.4 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
if (!defined('_CAN_LOAD_FILES_'))
|
||||
exit;
|
||||
|
||||
class StatsCatalog extends Module
|
||||
{
|
||||
private $_join = '';
|
||||
private $_where = '';
|
||||
|
||||
function __construct()
|
||||
{
|
||||
$this->name = 'statscatalog';
|
||||
$this->tab = 'analytics_stats';
|
||||
$this->version = 1.0;
|
||||
$this->author = 'PrestaShop';
|
||||
|
||||
parent::__construct();
|
||||
|
||||
$this->displayName = $this->l('Catalog statistics');
|
||||
$this->description = $this->l('General statistics about your catalog.');
|
||||
}
|
||||
|
||||
public function install()
|
||||
{
|
||||
return (parent::install() AND $this->registerHook('AdminStatsModules'));
|
||||
}
|
||||
|
||||
public function getQuery1()
|
||||
{
|
||||
return DB::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
|
||||
SELECT COUNT(DISTINCT p.`id_product`) AS total, SUM(p.`price`) / COUNT(`price`) AS average_price, COUNT(DISTINCT i.`id_image`) AS images
|
||||
FROM `'._DB_PREFIX_.'product` p
|
||||
LEFT JOIN `'._DB_PREFIX_.'image` i ON i.`id_product` = p.`id_product`
|
||||
'.$this->_join.'
|
||||
WHERE p.`active` = 1
|
||||
'.$this->_where);
|
||||
}
|
||||
|
||||
public function getTotalPageViewed()
|
||||
{
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
|
||||
SELECT SUM(pv.`counter`) AS viewed
|
||||
FROM `'._DB_PREFIX_.'product` p
|
||||
LEFT JOIN `'._DB_PREFIX_.'page` pa ON p.`id_product` = pa.`id_object`
|
||||
LEFT JOIN `'._DB_PREFIX_.'page_type` pt ON (pt.`id_page_type` = pa.`id_page_type` AND pt.`name` = \'product.php\')
|
||||
LEFT JOIN `'._DB_PREFIX_.'page_viewed` pv ON pv.`id_page` = pa.`id_page`
|
||||
'.$this->_join.'
|
||||
WHERE p.`active` = 1 '.$this->_where);
|
||||
return isset($result['viewed']) ? $result['viewed'] : 0;
|
||||
}
|
||||
|
||||
public function getTotalProductViewed()
|
||||
{
|
||||
return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
||||
SELECT COUNT(DISTINCT pa.`id_object`)
|
||||
FROM `'._DB_PREFIX_.'page_viewed` pv
|
||||
LEFT JOIN `'._DB_PREFIX_.'page` pa ON pv.`id_page` = pa.`id_page`
|
||||
LEFT JOIN `'._DB_PREFIX_.'page_type` pt ON pt.`id_page_type` = pa.`id_page_type`
|
||||
LEFT JOIN `'._DB_PREFIX_.'product` p ON p.`id_product` = pa.`id_object`
|
||||
'.$this->_join.'
|
||||
WHERE pt.`name` = \'product.php\'
|
||||
AND p.`active` = 1
|
||||
'.$this->_where);
|
||||
}
|
||||
|
||||
public function getTotalBought()
|
||||
{
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
|
||||
SELECT SUM(od.`product_quantity`) AS bought
|
||||
FROM `'._DB_PREFIX_.'orders` o
|
||||
LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON o.`id_order` = od.`id_order`
|
||||
LEFT JOIN `'._DB_PREFIX_.'product` p ON p.`id_product` = od.`product_id`
|
||||
'.$this->_join.'
|
||||
WHERE o.valid = 1
|
||||
'.$this->_where);
|
||||
return isset($result['bought']) ? $result['bought'] : 0;
|
||||
}
|
||||
|
||||
public function getProductsNB($id_lang)
|
||||
{
|
||||
$precalc = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('
|
||||
SELECT p.`id_product`
|
||||
FROM `'._DB_PREFIX_.'orders` o
|
||||
LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON o.`id_order` = od.`id_order`
|
||||
LEFT JOIN `'._DB_PREFIX_.'product` p ON p.`id_product` = od.`product_id`
|
||||
'.$this->_join.'
|
||||
WHERE o.valid = 1
|
||||
'.$this->_where.'
|
||||
AND p.`active` = 1
|
||||
GROUP BY p.`id_product`');
|
||||
|
||||
$precalc2 = array();
|
||||
foreach ($precalc as $array)
|
||||
$precalc2[] = (int)($array['id_product']);
|
||||
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('
|
||||
SELECT p.id_product, pl.name, pl.link_rewrite
|
||||
FROM `'._DB_PREFIX_.'product` p
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.`id_product` = p.`id_product` AND pl.id_lang = '.(int)($id_lang).')
|
||||
'.$this->_join.'
|
||||
WHERE p.`active` = 1
|
||||
'.(sizeof($precalc2) ? 'AND p.`id_product` NOT IN ('.implode(',', $precalc2).')' : '').'
|
||||
'.$this->_where);
|
||||
return array('total' => Db::getInstance(_PS_USE_SQL_SLAVE_)->NumRows(), 'result' => $result);
|
||||
}
|
||||
|
||||
public function hookAdminStatsModules($params)
|
||||
{
|
||||
global $cookie;
|
||||
$categories = Category::getCategories((int)($cookie->id_lang), true, false);
|
||||
$productToken = Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)($cookie->id_employee));
|
||||
$currency = Currency::getCurrency(Configuration::get('PS_CURRENCY_DEFAULT'));
|
||||
$link = new Link();
|
||||
$irow = 0;
|
||||
|
||||
if ($id_category = (int)(Tools::getValue('id_category')))
|
||||
{
|
||||
$this->_join = 'LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_product` = p.`id_product`)';
|
||||
$this->_where = 'AND cp.`id_category` = '.$id_category;
|
||||
}
|
||||
|
||||
$result1 = $this->getQuery1(true);
|
||||
$total = $result1['total'];
|
||||
$averagePrice = $result1['average_price'];
|
||||
$totalPictures = $result1['images'];
|
||||
$averagePictures = $total ? $totalPictures / $total : 0;
|
||||
|
||||
$neverBought = $this->getProductsNB((int)($cookie->id_lang));
|
||||
$totalNB = $neverBought['total'];
|
||||
$productsNB = $neverBought['result'];
|
||||
|
||||
$totalBought = $this->getTotalBought();
|
||||
$averagePurchase = $total ? ($totalBought / $total) : 0;
|
||||
|
||||
$totalPageViewed = $this->getTotalPageViewed();
|
||||
$averageViewed = $total ? ($totalPageViewed / $total) : 0;
|
||||
$conversion = number_format((float)($totalPageViewed ? ($totalBought / $totalPageViewed) : 0), 2, '.', '');
|
||||
if ($conversionReverse = number_format((float)($totalBought ? ($totalPageViewed / $totalBought) : 0), 2, '.', ''))
|
||||
$conversion .= ' (1 '.$this->l('purchase').' / '.$conversionReverse.' '.$this->l('visits').')';
|
||||
|
||||
$totalNV = $total - $this->getTotalProductViewed();
|
||||
|
||||
$html = '
|
||||
<script type="text/javascript" language="javascript">$(\'#calendar\').slideToggle();</script>
|
||||
<fieldset class="width3"><legend><img src="../modules/'.$this->name.'/logo.gif" /> '.$this->displayName.'</legend>
|
||||
<label>
|
||||
'.$this->l('Choose a category').'
|
||||
</label>
|
||||
<div class="margin-form">
|
||||
<form action="" method="post" id="categoriesForm">
|
||||
<select name="id_category" onchange="$(\'#categoriesForm\').submit();">
|
||||
<option value="0">'.$this->l('All').'</option>';
|
||||
foreach ($categories as $category)
|
||||
$html .= '<option value="'.$category['id_category'].'"'.($id_category == $category['id_category'] ? ' selected="selected"' : '').'>'.$category['name'].'</option>';
|
||||
$html .= '
|
||||
</select>
|
||||
</form>
|
||||
</div>
|
||||
<div class="clear space"></div>
|
||||
<table>
|
||||
'.$this->returnLine($this->l('Products available:'), (int)($total)).'
|
||||
'.$this->returnLine($this->l('Average price (base price):'), Tools::displayPrice($averagePrice, $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('<a style="cursor : pointer" onclick="$(\'#pnb\').slideToggle();">'.$this->l('Products never purchased:').'</a>', (int)($totalNB).' / '.(int)($total)).'
|
||||
'.$this->returnLine($this->l('Conversion rate*:'), $conversion).'
|
||||
</table>
|
||||
<div style="margin-top: 20px;">
|
||||
<span style="color:red;font-weight:bold">*</span>
|
||||
'.$this->l('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.').'
|
||||
</div>
|
||||
</fieldset>';
|
||||
|
||||
if (sizeof($productsNB) AND sizeof($productsNB) < 50)
|
||||
{
|
||||
$html .= '
|
||||
<fieldset class="width3 space"><legend><img src="../modules/'.$this->name.'/basket_delete.png" /> '.$this->l('Products never purchased').'</legend>
|
||||
<table cellpadding="0" cellspacing="0" class="table">
|
||||
<tr><th>'.$this->l('ID').'</th><th>'.$this->l('Name').'</th><th>'.$this->l('Edit / View').'</th></tr>';
|
||||
foreach ($productsNB as $product)
|
||||
$html .= '
|
||||
<tr'.($irow++ % 2 ? ' class="alt_row"' : '').'>
|
||||
<td>'.$product['id_product'].'</td>
|
||||
<td style="width: 400px;">'.$product['name'].'</td>
|
||||
<td style="text-align: right">
|
||||
<a href="index.php?tab=AdminCatalog&id_product='.$product['id_product'].'&addproduct&token='.$productToken.'" target="_blank"><img src="../modules/'.$this->name.'/page_edit.png" /></a>
|
||||
<a href="'.$link->getProductLink($product['id_product'], $product['link_rewrite']).'" target="_blank"><img src="../modules/'.$this->name.'/application_home.png" /></a>
|
||||
</td>
|
||||
</tr>';
|
||||
$html .= '
|
||||
</table>
|
||||
</fieldset>';
|
||||
}
|
||||
return $html;
|
||||
}
|
||||
|
||||
private function returnLine($label, $data)
|
||||
{
|
||||
return '<tr><td>'.$label.'</td><td style="color:green;font-weight:bold;padding-left:20px;">'.$data.'</td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user