Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

admin orders status box wrong


mikotondria

Recommended Posts

Posted

Hi,

I am noticing that on the admin/index.php page, the orders box is showing the wrong totals for the orders status' totals, ie, I might be showing:

 

Orders

Pending: 0

Processing: 3

Shipped: 21

 

Where as in reality, those orders showing as processing are actually shipped.

 

I believe this is because the query to lookup the statuses is referring only to the ORDERS table, and should be retrieving the most recent order_status from the ORDERS_HISTORY table.

I have found the query the the admin/orders.php page uses to get the 'real' status of the orders on that page, which is:

$orders_query_raw = "
select 
o.orders_id, 
o.customers_name, 
o.customers_id, 
o.payment_method, 
o.date_purchased, 
o.last_modified, 
o.currency, 
o.currency_value, 
s.orders_status_name, 
ot.text 
as 

order_total 

from 
" . TABLE_ORDERS . " o 
left join 
" . TABLE_ORDERS_TOTAL . " ot 
on (o.orders_id = ot.orders_id), 
" . TABLE_ORDERS_STATUS . " s 

where 

o.customers_id = '" . (int)$cID . "'and 
o.orders_status = s.orders_status_id 

and 
s.language_id = '" . (int)$languages_id . "' and 
ot.class = 'ot_total' 

order by orders_id DESC

 

I'll admit that this is a little beyond my SQL knowledge..

 

Can anyone rewire this query such that it returns the totals of each status, or is there a known fix to repair the query in the admin/index.php orders status totals box ??

 

Any help greatly appreciated :)

 

Many thanks,

Mike.

Posted
Hi,

I am noticing that on the admin/index.php page, the orders box is showing the wrong totals for the orders status' totals, ie, I might be showing:

 

Status: fixed.

 

My bad, I had a couple of test orders remaining in the db that were throwing the totals off, and I removed them and its all correct now.

 

Thx.

Archived

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

×
×
  • Create New...