Show Status of order in the NEW ORDERS table
Hello Ajah, :-)
Might there be a way to get the status to show in the NEW ORDERS table
next to the order in the ADMIN HOME.
This is how it looks now..
New orders:
Erick Martin $2,877.40
03/07/2011
CAN it look like this showing the current status..
Erick Martin $2,877.40
03/07/2011 Processing or whatever the current status is.
maybe ??
Thx
Erick
Re: Show Status of order in the NEW ORDERS table
This is a crude hack of the the code that I grabbed from another piece of code and did not clean up extra data that might be selected but it works:
/admin/index.php
you can change the code around line 155 to:
Code:
<?php
// "select o.orders_id as orders_id, o.customers_name as customers_name, o.customers_id, o.date_purchased as date_purchased, o.currency, o.currency_value, ot.class, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id and class = 'ot_total') order by orders_id DESC limit 5"
$orders = $db->Execute("select o.orders_id as orders_id, o.customers_id, o.customers_name as customers_name, o.payment_method, o.shipping_method, o.date_purchased as date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total" .
$new_fields . "
from (" . TABLE_ORDERS_STATUS . " s, " .
TABLE_ORDERS . " o " .
$new_table . ")
left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id and ot.class = 'ot_total') " . " order by orders_id DESC limit 5" );
while (!$orders->EOF) {
echo ' <div class="row"><span class="left"><a href="' . zen_href_link(FILENAME_ORDERS, 'oID=' . $orders->fields['orders_id'] . '&origin=' . FILENAME_DEFAULT, 'NONSSL') . '" class="contentlink"> ' . $orders->fields['customers_name'] . '</a></span><span class="center">' . $orders->fields['order_total'] . ' - ' . $orders->fields['orders_status_name'] . '</span><span class="rigth">' . "\n";
echo zen_date_short($orders->fields['date_purchased']);
echo ' </span></div>' . "\n";
$orders->MoveNext();
}
?>
and that should make it show up for you ...
Adjust as needed ...
Re: Show Status of order in the NEW ORDERS table
I lost every thing for that table,
I replaced this code here with yours uptop and the whole table disappered.. :-(
did I miss something ?
<?php $orders = $db->Execute("select o.orders_id as orders_id, o.customers_name as customers_name, o.customers_id, o.date_purchased as date_purchased, o.currency, o.currency_value, ot.class, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id and class = 'ot_total') WHERE o.orders_status < 4 order by orders_id DESC limit 5");
while (!$orders->EOF) {
echo ' <div class="row"><span class="left"><a href="' . zen_href_link(FILENAME_ORDERS, 'oID=' . $orders->fields['orders_id'] . '&origin=' . FILENAME_DEFAULT, 'NONSSL') . '" class="contentlink"> ' . $orders->fields['customers_name'] . '</a></span><span class="center">' . $orders->fields['order_total'] . '</span><span class="rigth">' . "\n";
echo zen_date_short($orders->fields['date_purchased']);
echo ' </span></div>' . "\n";
$orders->MoveNext();
}
?>
Re: Show Status of order in the NEW ORDERS table
Code:
$orders = $db->Execute("select o.orders_id as orders_id, o.customers_id, o.customers_name as customers_name, o.payment_method, o.shipping_method, o.date_purchased as date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total" .
$new_fields . "
from (" . TABLE_ORDERS_STATUS . " s, " .
TABLE_ORDERS . " o " .
$new_table . ")
left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id and ot.class = 'ot_total') " . " order by orders_id DESC limit 5" );
$new_fields . and $new_table . don't look like they belong here - they probably were part of the other code Ajeh took it from.
Re: Show Status of order in the NEW ORDERS table
That was IT !! removed those lines and it works..
Thank you so MUCH AGAIN !!!
for anyone who searches this here is the code as I have it
to show the status of an order right in the ADMIN HOME
<?php // "select o.orders_id as orders_id, o.customers_name as customers_name, o.customers_id, o.date_purchased as date_purchased, o.currency, o.currency_value, ot.class, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id and class = 'ot_total') order by orders_id DESC limit 5"
$orders = $db->Execute("select o.orders_id as orders_id, o.customers_id, o.customers_name as customers_name, o.payment_method, o.shipping_method, o.date_purchased as date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total" . " from (" . TABLE_ORDERS_STATUS . " s, " . TABLE_ORDERS . " o " . ") left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id and ot.class = 'ot_total') " . " order by orders_id DESC limit 5" );
while (!$orders->EOF) { echo ' <div class="row"><span class="left"><a href="' . zen_href_link(FILENAME_ORDERS, 'oID=' . $orders->fields['orders_id'] . '&origin=' . FILENAME_DEFAULT, 'NONSSL') . '" class="contentlink"> ' . $orders->fields['customers_name'] . '</a></span><span class="center">' . $orders->fields['order_total'] . ' - ' . $orders->fields['orders_status_name'] . '</span><span class="rigth">' . "\n"; echo zen_date_short($orders->fields['date_purchased']); echo ' </span></div>' . "\n"; $orders->MoveNext(); } ?>
Re: Show Status of order in the NEW ORDERS table
OOPs,
but the ADMIN home is now showing orders that are in deliverd status and it was NOT
before.
any way to fish them out again, so DELIVERED orders do NOT show ??
thx
Erick
Re: Show Status of order in the NEW ORDERS table
Silly silly me ... I forgot about those ... :blush:
Glad you go that working now ... :smile:
Re: Show Status of order in the NEW ORDERS table
Your original code (in post 3) shows
on (o.orders_id = ot.orders_id and class = 'ot_total') WHERE o.orders_status < 4
and the status check is missing from the new code.
Re: Show Status of order in the NEW ORDERS table
added her, no luck did I do it right ?
$orders = $db->Execute("select o.orders_id as orders_id, o.customers_id, o.customers_name as customers_name, o.payment_method, o.shipping_method, o.date_purchased as date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total" . " from (" . TABLE_ORDERS_STATUS . " s, " . TABLE_ORDERS . " o " . ") left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id and ot.class = 'ot_total') WHERE o.orders_status < 4 order by orders_id DESC limit 5");
Re: Show Status of order in the NEW ORDERS table
Let's step back and noticed I goobered up the SELECT ...
Try this and see if now all the ducks are in a row ...
Code:
$orders = $db->Execute("select o.orders_id as orders_id, o.customers_id, o.customers_name as customers_name, o.payment_method, o.shipping_method, o.date_purchased as date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total" .
$new_fields . "
from (" . TABLE_ORDERS_STATUS . " s, " .
TABLE_ORDERS . " o " .
$new_table . ")
left join " . TABLE_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 = '" . (int)$_SESSION['languages_id'] . "'
and o.orders_status < 5
order by orders_id DESC limit 5" );