Zen Cart Logo
Forums / General Questions / New Orders showing Old Orders

New Orders showing Old Orders

Locked

Views: 1,352

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
2 Jan 2008, 1:58 PM
#1
ojm avatar

ojm

New Zenner

Join Date:
Oct 2007
Posts:
68
Plugin Contributions:
0

New Orders showing Old Orders

Hi all,

Apologies if this is a dumb question, but I can't find any answers on this...

Under the admin main page, it shows the 'New Orders' heading / box, which obviously shows you new orders. However, it's also showing completed orders.

I admit we've only had 1 order, but I was hoping that when the order(s) is updated to 'Delivered' (or Shipped in my case), it won't show in the 'New Orders' box, as it's been completed.

Is there anyway of changing this, so it only shows orders which are in fact new?

Thanks!

2 Jan 2008, 2:55 PM
#2
absolute avatar

absolute

Totally Zenned

Join Date:
May 2005
Location:
Bath, Somerset
Posts:
1,054
Plugin Contributions:
2

Re: New Orders showing Old Orders

You can certainly do this, however, you will need to alter the SQL statement which pulls these orders into the admin index page.

For this, open admin/index.php of a zen1.3.8 install, and go to line 165 to find this code:

  <?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) where class = 'ot_total' order by orders_id DESC limit 5");

You now need to edit this sql statement so that it only pulls in the specific orders you need. So check your order status values, which can be found under Localization >> Order Status. As standard Delivered is order status 3, which is shown in the URL when you click on Delivered in this screen. So now you can do one of two things. You can either show all orders not delivered, or you can show orders which are placed, or pending.

So backup this file, and then replace the line above with the following:

Not Delivered:

  <?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) where ot.class = 'ot_total' and o.orders_status != '3' order by orders_id DESC limit 5");

Pending Or Processing

  <?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) where ot.class = 'ot_total' and (o.orders_status = '1' or o.orders_status = '2') order by orders_id DESC limit 5");

This code may need a little tweak to suit your exact setup, but you get the idea.

Good luck,

Absolute

2 Jan 2008, 9:07 PM
#3
ojm avatar

ojm

New Zenner

Join Date:
Oct 2007
Posts:
68
Plugin Contributions:
0

Re: New Orders showing Old Orders

Brilliant! Cheers Absolute!

10 Jan 2008, 6:19 PM
#4
leroyparker avatar

leroyparker

New Zenner

Join Date:
Dec 2007
Posts:
4
Plugin Contributions:
0

Re: New Orders showing Old Orders

For those of you cranking out 10+ orders per day I find this is pretty useful:

While you're in there, if you change the number of New Order results on line 165 to 12 (...DESC limit 12) and the number of New Customers to 8 on line 133 (I'm on v.1.3.7 so it may very slightly) it will make for a nice full squared off summary page that's far more useful.

-Bill

10 Jan 2008, 6:50 PM
#5
solarflare avatar

solarflare

Zen Follower

Join Date:
Sep 2006
Posts:
81
Plugin Contributions:
0

Re: New Orders showing Old Orders

Brilliant tweaks. Now Zen-Cart just needs to add this as admin configurations in a future version (1.5 plans for admin stuff?) - no reason it shouldn't be easily customizable.