Post by Qphoria » Fri Feb 03, 2012 2:49 am

[Q] Why are there so many Abandoned/Missing orders?
[Q] Why are my orders showing up as Cancelled?

A:

The way OpenCart is designed, it creates a "temp" order in the database during checkout as a way of keeping track of the order when "redirect" gateways are used. Things like Paypal or other gateways that force a customer to leave the site and redirect you to the gateway site to pay, and then return back to the site afterwards.

In 1.4.x, these temp orders get generated anytime the checkout/confirm page is loaded
In 1.5.x, these temp orders get generated anytime Step 6 is loaded.

When payments are made, these temp orders get updated with a final order status and made into real orders. But if they are not paid or if the customer left the checkout step and came back, a new temp order is created and the original one is just left in limbo.

The temp orders used to be cleaned up but we decided to keep them now to allow recovering actual customers who decided to leave without paying, in an attempt to try to contact them and convince them to come back and place the order.

But some problems with the current system are that new temp orders are created EVERY time the page is loaded. So if you got to the final step, went back to change the payment method, then came back to the final step, a new temp order is created. You might do that 5 times and then on the 6th time actually pay... So technically the first 5 temp orders do not need to be recovered since the customer actually paid on the 6th one. So this leads to a lot of confusion when you ask a customer why they didn't buy and they said they did. Also leaves a lot of temp orders that are never cleaned.

One solution for limiting the amount of temp orders is to reuse the order for the same customer if they already generated one. This solution is here: http://forum.opencart.com/viewtopic.php ... 192#p43453 and is working well. It just has not been adopted into the core yet, but hopefully will be soon.

With this fix in place, you will cut down on hundreds of temp orders that turned into real orders, allowing you to actually focus on recovering the remaining orders that are more likely actual abandoned orders. Also keeping your database cleaner.

To look at these temp orders, you can filter on the Admin->Sales->Order page and change the order status to "Abandoned" or "Missing" (depending on your version of OpenCart). If you edit these orders and go to the order history page, it looks like it is set to "Cancelled". but the reality is that there is simply no status and status select box defaults to the first alphabetical option. Cancelled is the first option alphabetically in the list so it is somewhat misleading and leads to people thinking orders are coming is as cancelled. But really it is just status-less.

It is possible that real orders can be stuck in this temp state after being paid if the callback fails due to any number of reasons:
- Firewall or port blocked on server
- Code bugs
- No response message sent back from gateway
- bad htaccess redirects setup.
- http basic password authentication blocking the message
For these you will be better off handling them on a case-by-case basis with their own questions in the forum.


If you'd like to manually clean up the temp orders in your database, you can run this sql command in phpmyadmin:

Code: Select all

DELETE FROM `oc_order` WHERE order_status_id = 0
change or remove the "oc_" part depending on your database prefix usage.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am
Who is online

Users browsing this forum: No registered users and 1 guest