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

Started by swguy on 20 Nov 2014, 12:23 AM · Views: 2,889

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,755
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"

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

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

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,755
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.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

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,512
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 ;)

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.