Jump to content

Issue - stats not showing visitors since October


Recommended Posts

Done a bit more digging. It appears that it is the Visitor column that is not working. Orders and Registrations are showing correctly but it's the Visitors figure that is remaining at zero. I've checked out the above link but I don't believe this will fix the problem as it appears to only be affecting visitors.

Link to comment
Share on other sites

As an added note I have just realised that if I go to the Visitors Online option in the Stats Dashboard it never shows anyone online. I have tried "Reset"ing the module and have changed the three Configure settings to something different and setting them back to the originals but it hasn't made any different.

Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...

I have the same issue. I build a site using presta 1.4.5.1, it's live since 19 december 2011, but since the the visitor online page show 0. These days I want to use those stats but nothing I try is working. moduel is enable , I replace with the latest SVN version but nothing. From stats only this is not working, i need it now

post-303594-0-49654600-1327653836_thumb.jpg

Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...
  • 2 weeks later...
  • 1 month later...

Hello.

 

Since upgrading to 1.4.7.3, I think, I have again the same issue, dates are not ordered properly. I'm running now 1.4.8.2. The workarounds posted previous arent up to date anymore, code has changed since then. Here's a screenshot from the current month selection.

post-294397-0-01317700-1340648745_thumb.png

Edited by cbelea (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...

Well, I think it's a bug in statsforecast.php. Unfortunatelly my programming skills aren't that advanced to repair it myself.

 

I've extracted the following query (line 115). My database holds data from November 2011.

SELECT
  LEFT(invoice_date, 10) AS fix_date,
  COUNT(DISTINCT o.id_order) AS countOrders,
  SUM(od.product_quantity) AS countProducts,
  SUM(od.product_price * od.product_quantity / o.conversion_rate) AS totalProducts
 FROM ps_orders o
 LEFT JOIN ps_order_detail od ON o.id_order = od.id_order
 LEFT JOIN ps_product p ON od.product_id = p.id_product
 WHERE o.valid = 1
 AND o.invoice_date BETWEEN  '2011-11-01 00:00:00' AND '2012-06-30 23:59:59'
 GROUP BY LEFT(invoice_date, 10)
 ORDER BY fix_date

 

It's displays correctly. So the problem has to be in the way the data is displayed in the php.

 

Putting a print_r($dataTable); in row 129, right after

 while ($row = $db->nextRow($result))
  $dataTable[$row['fix_date']] = $row;

outputs:

 

Array ( [2012-06-29] => Array ( [fix_date] => 2012-06-29 [countOrders] => 14 [countProducts] => 168 [totalProducts] => 5449.9999720000 ) [2012-06-30] => Array ( [fix_date] => 2012-06-30 [countOrders] => 0 [countProducts] => 0 [totalProducts] => 0 ) [2011-11-02] => Array ( [fix_date] => 2011-11-02 [countOrders] => 1 [countProducts] => 6 [totalProducts] => 117.0000000000 ) [2011-11-08] => Array ( [fix_date] => 2011-11-08 [countOrders] => 1 [countProducts] => 5 [totalProducts] => 98.0000000000 ) [2011-11-15] => Array ( [fix_date] => 2011-11-15 [countOrders] => 1 [countProducts] => [totalProducts] => ) etc

 

So the array is messed up. Starts with June data and continues with November.

 

Moving on. I've set a print_r($dataTable); on line 105, right after

 $dataTable = array();
 if ($cookie->stats_granularity == 10)
  for ($i = $from; $i <= $to2; $i = strtotime('+1 day', $i))
$dataTable[date('Y-m-d', $i)] = array('fix_date' => date('Y-m-d', $i), 'countOrders' => 0, 'countProducts' => 0, 'totalProducts' => 0);

All output is:

Array ( [2012-06-29] => Array ( [fix_date] => 2012-06-29 [countOrders] => 0 [countProducts] => 0 [totalProducts] => 0 ) [2012-06-30] => Array ( [fix_date] => 2012-06-30 [countOrders] => 0 [countProducts] => 0 [totalProducts] => 0 ) )

Should not the whole array be initialized?

Link to comment
Share on other sites

×
×
  • Create New...