Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Database Error on order processing


Guest

Recommended Posts

We are running osC 2.2 ms2

 

We recently received an email notification of a new order. I logged into the admin area but the order does not show up in the Orders List, nor is it associated with the Customer. I can search for the order by it's number and sure enough it is in there.

 

When the customer logs into their account, the order does not show up their either.

 

Can anyone tell me which database tables should I be looking at to reestablish the link between the customer and their order / and to make the order appear in admin on the Orders List? The order is in the cart, it's just not showing up unless you run a search for it in the admin area.

 

Any help would be greatly appreciated. I can work with MySQL just fine, I just cannot figure out which tables create this relationship.

 

Thanks in advance!

Link to comment
Share on other sites

Look at table 'orders'. There you find the fields 'orders_id' and 'customers_id'. There is where the link takes place. Take a look and tell us what's wrong.

Acutally there is nothing wrong in the table "orders". The first field shows the orders_id, which is correct, and the second field shows customers_id, which is also correct. And yet, the order is not showing up in the admin Orders list, nor under the users account when they login to the shopping cart.

 

Back to square one ... where else might this relationship be broken?

 

Thanks!!

Link to comment
Share on other sites

Mmmm, take a look at 'orders_total' to see if everithing is fine. I think that if 'orders_total' is broken orders won't show (even though there is no customers_id field).

 

By the way, are you experiencing this problem with all the orders or just the last ones?

Link to comment
Share on other sites

OK -- found the bug...

 

in orders_status_history, there were two entries denoting the current processing state of this order. the second entry showed an order_status_id of "0" (why? i don't know). we have three possible order status's, as shown in table orders_status, with ids respectively of 1, 3 and 4 (no "0"). upon deleting this record from the orders_status_id table - everything returned to normal.

 

so the new question is -- how did the database write a value of 0 to a field where 0 is not an option? i'm guessing that the processing connection may have been interrupted when the admin or user when to update the order and the processing information was never properly sent to the database - leaving a default value of 0 ???

Link to comment
Share on other sites

OK -- found the bug...

 

in orders_status_history, there were two entries denoting the current processing state of this order.  the second entry showed an order_status_id of "0" (why? i don't know).  we have three possible order status's, as shown in table orders_status, with ids respectively of 1, 3 and 4 (no "0").  upon deleting this record from the orders_status_id table - everything returned to normal.

 

so the new question is -- how did the database write a value of 0 to a field where 0 is not an option?  i'm guessing that the processing connection may have been interrupted when the admin or user when to update the order and the processing information was never properly sent to the database - leaving a default value of 0 ???

 

I read your post with interest, as I have a customer that is suddenly having the same problem. It does not happen with every order, just every now and then he will be notified by his merchant account that a payment was made, yet when he checks the admin, just as you described, there is no order there. I'm at a loss as to what is causing this. Any ideas?

Link to comment
Share on other sites

FINAL FIX -- got it all working (i know i said that before - but i was mistaken). My previous fix (above) is correct in that it is the first 1/2 of the solution -- here's the rest of it:

 

In the table 'orders' field 'orders_status' -- this field was showing as 0 - upon changing this to 3 (processed) the order showed up again in the admin area.

 

WHY DOES THIS HAPPEN?

 

My only guess as to what causes this is something on the server. As PHP is a server side function, once the user hits the final confirmation button, it's all on the server at that point. I don't believe that even a bad Internet connection from the user could do this - so I am looking at the server for this one. Perhaps a busy server is the answer. If there is any way to track the load on a server by logging the load values every, say ... 5 minutes, and have those loads associated with the time of day - you could probably correlate how busy the server is at the time the failed orders are placed. That's my first guess as to where the problem lies.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...