Hey All,

Just playing around,customizing the admin of one of our sites (Zen 1.3.8) and trying to modify the main Admin home page's Order summary section (bottom left) with the various Order Status'.

What I'm trying to do is something similar to how one line entry 'Totals' up the number of (for example) Pending Orders but instead of just displaying the 'Number' of Pending Orders as it does, I'm wanting to associate a total cost of the number of Pending Orders as well - say just to the right.

~ (Basically I'm just trying to create a brief heads up of how much is pending, how much invoiced, etc.) ~

Still getting my feet wet with some elements of PHP (in particular cross-connecting tables), but I know the ORDERS_TOTAL table contains the entry I'll need ('text' I believe in particular) but needing the line itself to Add up all orders with the particular order status, while still relating to the Order Status line item.

(Hoping this makes sense btw, brain's in a bit of a fog after delving into this afternoon without it not quite firing correctly).

On the index.php page within the admin, around Line 131 I'm looking at the line:

$orders_pending = $db->Execute("select count(*) as count from " . TABLE_ORDERS . " where orders_status = '" . $orders_status->fields['orders_status_id'] . "'");


and attempting to replicate it, something like this:

$orders_pending2 = $db->Execute("select ot.text from (" . TABLE_ORDERS . " o, " . TABLE_ORDERS_TOTAL . " ot ) " . " where o.orders_status = '" . $orders_status->fields['orders_status_id'] . "'");


Unfortunately as-is doesn't grab all the info correctly, nor does it total together like how the count(*) does on the original example.

Does anyone know where I might be running amuck? Get the feeling I'm just missing something but appreciate any advice or examples on how to properly code the query.

Thanks!!! Jess