Jump to content
wagac2012

PS 1.6.0.9 order stats not showing except visits and registration

Recommended Posts

After upgrade from 1.5 to 1.6 which was made on 10th of august, I have orders but no stats upgrade

I uninstalled and installed again all modules related to stats (at least those I think they are in the module list)

Result is now I have the visits and the new registrations in the stats dashboard, before was 0 everywhere

placed orders and revenues don't update even if I had 9 orders today, they show 0

in the conversion panel below the data looks good

 

 

 

Share this post


Link to post
Share on other sites

I have the same problem.  I used to (in PS 1.5) be able to go in and manually change the order status to a Paypal Authorization accepted to get them to show up (which was super annoying anyway).  Now, no matter the status, the order does not count as 'revenue' or an actual sale.  Very frustrating.

Share this post


Link to post
Share on other sites

I have the same problem. Dashbord sales, orders, carts, visits = 0 even if I received orders.

I only have the information of visitors online.

 

Before I installed google analytics module, it seems to me that the dashboard sent me wrong informations. Now that google analytics module (who doesn't work !!) is installed dashboard results are 0.

 

Can somebody help us ?

Share this post


Link to post
Share on other sites

Ciao #3 for the Google analytics reset uninstall then install it again. On my website it is working now. But the Dashboard sales still nothing. At least I have the stats on analytics...

Share this post


Link to post
Share on other sites

Figured this out late last week - 

 

for me, I didn't give customers the ability to print PDF invoices.  This seemed totally unnecessary.  But enabling it again meant that all of the statistics showed up.  Make sure the default order status allows customers to print invoices and then make sure it is enabled overall in the settings.

 

Good luck friend, I hope you had the same issue.

  • Like 1

Share this post


Link to post
Share on other sites

Ciao rukristin,

thanks for the tip, for me turning up invoice is a management problem with the real shop. They make receipts and not invoices and let the user print the invoice will result in a huge tax system problem if there is a company who will print and register the wrong invoice.
But this thing of the invoice enabled was not causing problems with PS 1.5 before, why now?

Thanks again for the suggestion. Will try anyway...

Share this post


Link to post
Share on other sites

From 1.6.0.8 the stats has been modified to display statistics for order state - payment recd/delivered. If the order state is not changed to these status, the stats module doesnt display anything. I have copy back the adminstatscontroller of 1.6.0.8 so my stats page now shows all orders instead of payment recd. This setting is good only for stores which work on paypal and online payment only but when use COD, then the stats wont display these orders until you mark them as payment recd.

 

These are some changes that went ahead from 1.6.0.8 and when there is active discussions going on to test tax rounding, these stats also need to be considered to work for all order status. The configuration should be common for all countries and not restricted to work with few stores.

  • Like 1

Share this post


Link to post
Share on other sites

I'm sorry, could you explain a bit more? I have trouble understanding what you are trying to say :(   Sorry

Share this post


Link to post
Share on other sites

Ciao rukristin,

thanks for the tip, for me turning up invoice is a management problem with the real shop. They make receipts and not invoices and let the user print the invoice will result in a huge tax system problem if there is a company who will print and register the wrong invoice.

But this thing of the invoice enabled was not causing problems with PS 1.5 before, why now?

 

Thanks again for the suggestion. Will try anyway...

 

Hi wagac

I updated PS to the version 1.6.9 and now the stats not working. I cannot to enable the invoice. How do you solve it?

Share this post


Link to post
Share on other sites

Anyone? Your help would be very much appreciated!

 

Hi,

 

I did these steps and I soved it:

 

- I activated the invoices

- If you active the invoice, all the statistics will be ok for the new orders

- If you have some orders did without this flag ON with the new version 1.6.9 you have to update the records in the database.

- I changed these files:

 

/classes/PaymentModule.php $file_attachement = null; (riga: 749 ) /classes/order/OrderHistory.php $file_attachement = null; (riga: 419 ) /themes/transformer/history.tpl commentato link pdf-invoice /themes/transformer/order-slip.tpl commentato link pdf-invoice /themes/transformer/order-follow.tpl commentato link pdf-invoice
 
to disable the link of pdf in the Site and to not send the attached of pdf via email
 
Ciao
Angela
  • Like 2

Share this post


Link to post
Share on other sites

Ciao Angela, grazie! molto gentile.

 

modified all the files. The only thing I have to do is update the records in the database. Can you show, explain how to do it?

Share this post


Link to post
Share on other sites

Ciao Angela, grazie! molto gentile.

 

modified all the files. The only thing I have to do is update the records in the database. Can you show, explain how to do it?

 

Ciao,

 

I did these sql for the orders inputed after the upgrade at the PS. 1.6.9 without the flag activation invoice = false.

 

SELECT * FROM ps_orders where id_order >=your id number
;
 
update ps_orders set invoice_number = id_order where id_order >= your id number
and invoice_number = " "
;
 
SELECT * FROM ps_order_invoice where id_order >=your id number
;
 
insert into ps_order_invoice ( 
    id_order_invoice               ,
    id_order                       ,
    number                         ,
    delivery_number                 ,
    total_discount_tax_excl         ,
    total_discount_tax_incl         ,
    total_paid_tax_excl             ,
    total_paid_tax_incl             ,
    total_products                 ,
    total_products_wt               ,
total_shipping_tax_excl  ,   total_shipping_tax_incl ,
    total_wrapping_tax_excl        ,
    total_wrapping_tax_incl         ,
    date_add                      
 
) SELECT  id_order, id_order, invoice_number, 0, 0, 0, total_paid_tax_excl  ,   total_paid_tax_incl  ,   total_products    , 
total_products_wt , total_shipping_tax_excl  ,   total_shipping_tax_incl ,
    total_wrapping_tax_excl        ,
    total_wrapping_tax_incl         ,date_add
FROM ps_orders where id_order >= your id number
;
 
 
SELECT * FROM ps_order_invoice_payment where id_order >=your id number
;
 
insert into ps_order_invoice_payment ( 
SELECT ps_order_invoice.id_order_invoice, ps_order_payment.id_order_payment, ps_order_invoice.id_order 
FROM ps_orders, ps_order_payment, ps_order_invoice
where ps_order_payment.order_reference = ps_orders.reference
and ps_orders.id_order = ps_order_invoice.id_order
and ps_orders.id_order >= your id number
)
;
 
 
I hope to be of help
 
Ciao
angela
  • Like 1

Share this post


Link to post
Share on other sites

OK - NOW SOLVED 100%

follow the instructions given by Angela in thread #12, then backup DB, then phpMyAdmin and run the following queries, entering the order ID since the stats disappeared. My was 2237

SELECT * FROM ps_orders where id_order >=2237;
UPDATE ps_orders SET invoice_number = id_order WHERE id_order >= 2237 AND invoice_number = '';

SELECT * FROM ps_order_invoice where id_order >=2237;
INSERT into ps_order_invoice (id_order_invoice, id_order,number, delivery_number, total_discount_tax_excl, total_discount_tax_incl, total_paid_tax_excl, total_paid_tax_incl, total_products, total_products_wt, total_shipping_tax_excl, total_shipping_tax_incl, total_wrapping_tax_excl, total_wrapping_tax_incl, date_add) SELECT id_order, id_order,invoice_number, 0, 0, 0, total_paid_tax_excl, total_paid_tax_incl, total_products, total_products_wt, total_shipping_tax_excl, total_shipping_tax_incl, total_wrapping_tax_excl, total_wrapping_tax_incl, date_add FROM ps_orders WHERE id_order >= 2237;

SELECT * FROM ps_order_invoice_payment where id_order >=2237;
INSERT into ps_order_invoice_payment ( SELECT ps_order_invoice.id_order_invoice, ps_order_payment.id_order_payment,ps_order_invoice.id_order FROM ps_orders,ps_order_payment,ps_order_invoice WHERE ps_order_payment.order_reference = ps_orders.reference AND ps_orders.id_order = ps_order_invoice.id_order AND ps_orders.id_order >= 2237);

Had to clean up the Angela's code a little bit (because of the forum editor mess up), put the first order ID after 1.6.9 upgrade and the queries worked, took a look in the DB tables and data seems ok.

 

However there were some ps_order.invoice_date set to 0 so I run the following SQLquery:

SELECT * FROM ps_orders where id_order >=2159;
UPDATE ps_orders SET invoice_date = date_add WHERE id_order >= 2159;

and now all is showing as it should! dashboard and stats finally Supercool.

Edited by wagac2012 (see edit history)
  • Like 1

Share this post


Link to post
Share on other sites

I have exactly the same problem - the dashboard and the stats are not updating. The stats are showing page visits, in some places they are showing the orders but in the total they don't.

 

This fix didn't help me though... :(

Share this post


Link to post
Share on other sites

Hello!
I have the same problem on 1.5.6.2. I noticed that when customer loyalty and rewards module is enabled prestashop doesn't update invoice_date in ps_order table. I also have problem with valid field. Changing order statuses not update this field (from 0 to 1) even if "Consider the associated order as validated" is checked. Does anyone know how to solve this problem?

Share this post


Link to post
Share on other sites

Hello. Is there any possibility to switch ON invoices inside PrestaShop but disable/block/switch off them to the client? Without modyfing template.

 

As I understand and as I can chceck in PS 1.6.0.8 (AdminStatsController.php) is important to have ps_orders.invoice_date in the database but ps_orders_invoice.* is not necessary.

Share this post


Link to post
Share on other sites

If I want update all my orders with Angela query how i have to modify this query?

 

SELECT * FROM ps_orders where id_order >=your id number
;
update ps_orders set invoice_number = id_order where id_order >= your id number
and invoice_number = " "
;
SELECT * FROM ps_order_invoice where id_order >=your id number
;
insert into ps_order_invoice ( 
    id_order_invoice               ,
    id_order                       ,
    number                         ,
    delivery_number                 ,
    total_discount_tax_excl         ,
    total_discount_tax_incl         ,
    total_paid_tax_excl             ,
    total_paid_tax_incl             ,
    total_products                 ,
    total_products_wt               ,
total_shipping_tax_excl  ,   total_shipping_tax_incl ,
    total_wrapping_tax_excl        ,
    total_wrapping_tax_incl         ,
    date_add                      
 
) SELECT  id_order, id_order, invoice_number, 0, 0, 0, total_paid_tax_excl  ,   total_paid_tax_incl  ,   total_products    , 
total_products_wt , total_shipping_tax_excl  ,   total_shipping_tax_incl ,
    total_wrapping_tax_excl        ,
    total_wrapping_tax_incl         ,date_add
FROM ps_orders where id_order >= your id number
;
SELECT * FROM ps_order_invoice_payment where id_order >=your id number
;
insert into ps_order_invoice_payment ( 
SELECT ps_order_invoice.id_order_invoice, ps_order_payment.id_order_payment, ps_order_invoice.id_order 
FROM ps_orders, ps_order_payment, ps_order_invoice
where ps_order_payment.order_reference = ps_orders.reference
and ps_orders.id_order = ps_order_invoice.id_order
and ps_orders.id_order >= your id number
)
;

Share this post


Link to post
Share on other sites

Sad but true!

 

This problem still persist in PS. 1.6.0.14

 

the stats do not show any orders even if I enable or disable invoice, change the statuses in any...

 

Any good solution please??

Share this post


Link to post
Share on other sites

I'm mainly using 1.6.0.9, but I've tested and this behaviour also seems to be in 1.6.1.1 (the latest!)

 

There could be different reasons why stats are not showing up. But I've determined that my cause is that when invoices are turned off, statistics are not generated. I don't know if this is a feature or a bug, but it is causing problems for certain use cases.

 

The code in AdminStatsController.php is a bit confusing. If you read the SQL in that file, you will see that in order to retrieve the number of orders and sales, etc, PrestaShop requires the invoice_date to exist and be a valid date in the ps_orders table for that query to return anything, otherwise the SQL will return no rows.

 

That seems like outright bizarre logic; after all, just because an invoice has been generated does not in any way qualify it as "validated". I would have thought using the date_add column rather than the invoice_date column would be the right thing to do. 

 

I don't know what was the exact cause of OP's statistics issue, but I highly doubt running the Angela's queries will do anything to solve the root of the problem. It may however, force all orders and sales up to the point of running to query to appear. Then again, new orders will not show. The first query also incorrectly sets your invoice numbers using the primary key of the orders table! Yikes!

Edited by helloworlder (see edit history)

Share this post


Link to post
Share on other sites

I agree, that statistics shouldn't be dependent on fact that prestashop invoice being created. Its just design flaw. I had same problem, because I am not using built-in invoice system (as 80% of prestashop users, I guess), so I had to find some working solution for the long run, that persists even after upgrades.

 

You need just to override AdminStatsController.php in such way that it will take date_add instead of invoice_date.

 

100% working solution step by step is included in this post:

https://www.prestashop.com/forums/topic/367885-dashboard-stats-are-empty-after-upgrading-to-1609/?p=2151011

 

And remember to delete /cache/class_index.php after creating this override. That fix is cheking stats based on order add date and not invoice date.

 

Works fine on Prestashop 1.6.1.x with invoice disabled (with enabled invoice its working also).

Edited by hootersam (see edit history)

Share this post


Link to post
Share on other sites

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More