Zen Cart Logo
Forums / Bug Reports / [Not a bug] Duplicate order ids show in admin->customers->orders

[Not a bug] Duplicate order ids show in admin->customers->orders

Locked

Views: 2,886

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
20 Nov 2014, 12:23 AM
#1
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,711
Plugin Contributions:
56

[Not a bug] Duplicate order ids show in admin->customers->orders

You can see from the attached image that the same order number shows up twice for the last 2 orders.

Attachment 14708

The debug statement on line 843 (when uncommented) displays

I SEE C: select o.orders_id, o.customers_id, o.customers_name, o.payment_method, o.shipping_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total, o.customers_company, o.customers_email_address, o.customers_street_address, o.delivery_company, o.delivery_name, o.delivery_street_address, o.billing_company, o.billing_name, o.billing_street_address, o.payment_module_code, o.shipping_module_code, o.ip_address from (zen_orders_status s, zen_orders o ) left join zen_orders_total ot on (o.orders_id = ot.orders_id and ot.class = 'ot_total') where (o.orders_status = s.orders_status_id and s.language_id = '1') order by o.orders_id DESC

I believe this could be fixed by modifying admin/orders.php line 841 to add just before the order by " GROUP BY o.orders_id"

20 Nov 2014, 1:21 AM
#2
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,711
Plugin Contributions:
56

Re: [Not a bug] Duplicate order ids show in admin->customers->orders

ARGH! This issue was created by a database with dangling records. I thought I had cleaned out some records but hadn't.

25 Apr 2015, 7:22 AM
#3
eric_chen avatar

eric_chen

New Zenner

Join Date:
May 2012
Posts:
39
Plugin Contributions:
0

Re: [Not a bug] Duplicate order ids show in admin->customers->orders

I got the same problem after I used "TRUNCATE TABLE orders" on my database.

Afterwards, I recovered these tables with "Order_..." in my database, and then it works right.

27 Apr 2015, 2:47 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: [Not a bug] Duplicate order ids show in admin->customers->orders

Eric Chen:

I got the same problem after I used "TRUNCATE TABLE orders" on my database.
Yup. TRUNCATE is a bad thing to do without first studying how all the 93 database tables interact with each other ;)