Jump to content

How to trace product clicks ?


Recommended Posts

The problem is that it doesn't display products that haven't been bought yet. You'd have to modify modules/statsbestproducts/statsbestproducts.php and delete the following lines from the queries to display all products:

WHERE p.active = 1 AND o.valid = 1
AND o.invoice_date BETWEEN '.$dateBetween.'

Link to comment
Share on other sites

public function getTotalCount($dateBetween)
{
$result = Db::getInstance()->GetRow('
SELECT COUNT(DISTINCT p.`id_product`) totalCount
FROM `'._DB_PREFIX_.'product` p
LEFT JOIN '._DB_PREFIX_.'order_detail od ON od.product_id = p.id_product
LEFT JOIN '._DB_PREFIX_.'orders o ON od.id_order = o.id_order
WHERE p.active = 1 AND o.valid = 1
AND o.invoice_date BETWEEN '.$dateBetween);
return $result['totalCount'];
}


AND


FROM '._DB_PREFIX_.'product p
LEFT JOIN '._DB_PREFIX_.'product_lang pl ON (p.id_product = pl.id_product AND pl.id_lang = '.intval($this->getLang()).')
LEFT JOIN '._DB_PREFIX_.'order_detail od ON od.product_id = p.id_product
LEFT JOIN '._DB_PREFIX_.'orders o ON od.id_order = o.id_order
LEFT JOIN '._DB_PREFIX_.'currency c ON o.id_currency = c.id_currency
WHERE p.active = 1 AND o.valid = 1
AND o.invoice_date BETWEEN '.$dateBetween.'
GROUP BY od.product_id';

Link to comment
Share on other sites

Yes, change the first one from:

WHERE p.active = 1 AND o.valid = 1
AND o.invoice_date BETWEEN '.$dateBetween);



to:

WHERE p.active = 1');



and the second one from:

WHERE p.active = 1 AND o.valid = 1
AND o.invoice_date BETWEEN '.$dateBetween.'



to:

WHERE p.active = 1

Link to comment
Share on other sites

Many Many Thanks !!

AFter i replaced with ur file.
The stats page recover, but still display a blank page in all BEST modules.....

Best product, best categories, best supplier, best promotion.......

cry...cry.......

what i go wrong ?

Link to comment
Share on other sites

Replacing that file should not affect the "Best categories", "Best supplier" or "Best promotion" modules. It should only affect the "Best products" module. It's working on my test site. Now all products including ones with a quantity of 0 are displayed in the "Best products" module.

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...
  • 6 months later...
×
×
  • Create New...