Jump to content

Weird dashboard/stats bug


Recommended Posts

I'm experiencing a bit of an issue with my sales figures. The system I'm using is fairly bespoke so I don't expect a perfect solution but any insight will be great.


For some reason a chunk of our orders aren't registering on the prestashop dashboard sales figures and the figures on the stats pages. All of the orders are made up of two order statuses, payment accepted and payment authorised. Both of which count as paid (I made sure the settings for authorised are identical to accepted).


I think I may have isolated what I think has caused this problem. I've got one product on preorder at the moment and to avoid confusion with the shipping/warehouse department I've made it so if someone buys that specific product with any other products the order will be split into two separate orders. They share the same reference but not the same order id. This has been done by using the advanced stock management system on that product with a dedicated warehouse for it.


We've used this functionality in the past with no major issues but this year we've introduced a new payment gateway. Rather than marking a payment as accepted this gateway marks an order as authorized and then uses a web hook system to update it to payment accepted a few minutes later. I believe the two features are interfering with each other, as the first split is being marked as accepted, whereas the other split isn't being updated and being left as authorised.


I've worked out that all of the orders with this preorder product (as well as the other part of the split) add up to approximately the amount that we've got missing from our stats.


I've tried updating the order status for these order but it doesn't change anything.


I just wanted to know if anyone has any idea what could possibly be done to resolve this issue.

Link to comment
Share on other sites

After some investigating on our end we worked out what was causing this issue. Hopefully the following information will help someone out in the future.


When an order gets split the first order of the two doesn't get given an invoice date. Because of this prestashop has no way of knowing where to put the sales. We resolved this by finding all the orders within the ps_orders database that had a invoice date of "0000-00-00 00:00:00" and that also has a current status of 2 or 42 (42 being payment authorised in my case). Then we replaced the invoice date for those fields with the "date_added" column.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...