Forums / General Questions / Show Status of order in the NEW ORDERS table

Show Status of order in the NEW ORDERS table

Started by gloerick on 7 Mar 2011, 11:25 PM · Views: 1,403

Results 1 to 17 of 17
7 Mar 2011, 11:25 PM
#1
gloerick avatar

gloerick

Zen Follower

Join Date:
Feb 2006
Location:
Boise, ID
Posts:
330
Plugin Contributions:
0

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

8 Mar 2011, 12:19 AM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

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:

  <?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 ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

8 Mar 2011, 12:51 AM
#3
gloerick avatar

gloerick

Zen Follower

Join Date:
Feb 2006
Location:
Boise, ID
Posts:
330
Plugin Contributions:
0

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(); } ?>
8 Mar 2011, 1:14 AM
#4
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: Show Status of order in the NEW ORDERS table

  $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.
8 Mar 2011, 1:26 AM
#5
gloerick avatar

gloerick

Zen Follower

Join Date:
Feb 2006
Location:
Boise, ID
Posts:
330
Plugin Contributions:
0

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(); } ?>
8 Mar 2011, 1:28 AM
#6
gloerick avatar

gloerick

Zen Follower

Join Date:
Feb 2006
Location:
Boise, ID
Posts:
330
Plugin Contributions:
0

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

8 Mar 2011, 1:28 AM
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

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:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

8 Mar 2011, 1:35 AM
#8
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

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.

8 Mar 2011, 1:37 AM
#9
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Show Status of order in the NEW ORDERS table

See what happens when you hack code and do not pay attention to where you get it from ...

Thanks for catching those ... :lamo:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

8 Mar 2011, 1:40 AM
#10
gloerick avatar

gloerick

Zen Follower

Join Date:
Feb 2006
Location:
Boise, ID
Posts:
330
Plugin Contributions:
0

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");

8 Mar 2011, 1:55 AM
#11
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

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 ...

  $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" );

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

8 Mar 2011, 2:21 AM
#12
gloerick avatar

gloerick

Zen Follower

Join Date:
Feb 2006
Location:
Boise, ID
Posts:
330
Plugin Contributions:
0

Re: Show Status of order in the NEW ORDERS table

still showing the "DELIVERED" code [4]

my complete code is

<?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') " . " 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" ); 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(); } ?>
8 Mar 2011, 2:39 AM
#13
gloerick avatar

gloerick

Zen Follower

Join Date:
Feb 2006
Location:
Boise, ID
Posts:
330
Plugin Contributions:
0

Re: Show Status of order in the NEW ORDERS table

got it,

I chaged
and o.orders_status < 5
order by orders_id DESC limit 5" );

to

and o.orders_status < 4
order by orders_id DESC limit 5" );

as the 4 is the DELIVERD number.
Thx so much..

hope this can help others looking to do the same.

8 Mar 2011, 3:55 AM
#14
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Show Status of order in the NEW ORDERS table

Thanks for the update that you now have this working for you ... :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

14 Mar 2011, 9:09 PM
#15
gloerick avatar

gloerick

Zen Follower

Join Date:
Feb 2006
Location:
Boise, ID
Posts:
330
Plugin Contributions:
0

Re: Show Status of order in the NEW ORDERS table

Hello Ajeh,

 This MOd for the NEW ORDERS in the admin is working great,

however it only shows 5 new orders at a time, and I have more than that to keep track of
until marked as delivered.

Where can I change the max display for that from 5 to say 50 so I do not have to worry about it again ?

Thx,
Erick

14 Mar 2011, 9:14 PM
#16
gloerick avatar

gloerick

Zen Follower

Join Date:
Feb 2006
Location:
Boise, ID
Posts:
330
Plugin Contributions:
0

Re: Show Status of order in the NEW ORDERS table

GOT it..

Folowed your posting back to admin/index.php
looked for "5" added a 0 and refreshed.. :-) crude but got it :-)

also made the new customer list to 20 from 5 :-)

Thx.. I'm learning :-)

Erick

14 Mar 2011, 11:13 PM
#17
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Show Status of order in the NEW ORDERS table

Thanks for the update that you were able to change the number displayed ... :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!