Zen Cart Logo
Forums / General Questions / Changing the sort order for order status

Changing the sort order for order status

Locked

Views: 4,948

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
22 Aug 2008, 1:13 AM
#1
heavenlynights avatar

heavenlynights

Zen Follower

Join Date:
Jan 2006
Location:
Australia
Posts:
303
Plugin Contributions:
0

Changing the sort order for order status

Hi there

I need to change the sort order for order status, however there is nowhere in the admin that I can see, where to do this.

Can I change these directly through the database via phpMyAdmin, without compromising any of my previous customers orders?

I need to do this so that I can get the the store_credit_v3.02 mod to work properly.

Any Help would be appreciated.

TIA

15 Jun 2009, 4:24 PM
#2
coldmachineuk avatar

coldmachineuk

New Zenner

Join Date:
Jun 2009
Posts:
3
Plugin Contributions:
0

Re: Changing the sort order for order status

I'm having the same problem - I know this topic is nearly a year old, but is there a solution to this?
I adjusted the order_status_id field via PHPMyAdmin and despite them now showing in id order in the Localization -> Order Status menu the various order status options are showing out of order in the pulldown menu in the detailed order screen (Customers -> Orders -> Specific order)

Any solution?

15 Jun 2009, 11:16 PM
#3
heavenlynights avatar

heavenlynights

Zen Follower

Join Date:
Jan 2006
Location:
Australia
Posts:
303
Plugin Contributions:
0

Re: Changing the sort order for order status

coldmachineUK:

I'm having the same problem - I know this topic is nearly a year old, but is there a solution to this?
I adjusted the order_status_id field via PHPMyAdmin and despite them now showing in id order in the Localization -> Order Status menu the various order status options are showing out of order in the pulldown menu in the detailed order screen (Customers -> Orders -> Specific order)

Any solution?

Unfortunately I never got response to this, u are the first since I posted it. I didn't even try what you have done even though i thought about it (didn't want to risk stuffing things up lol).

It would be nice if one of the techies could give us a hand with one.

15 Jun 2009, 11:48 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Changing the sort order for order status

coldmachineUK:

I adjusted the order_status_id field via PHPMyAdmin ...
**I hope you made good database backups before you went muddling in the data **without knowing how those numbers relate to everything else!!!
Changing order_status_id could mess up ALL KINDS of things!!! ... unless you also make the identical change in every other table that uses that number for any purpose.

16 Jun 2009, 7:22 AM
#5
coldmachineuk avatar

coldmachineuk

New Zenner

Join Date:
Jun 2009
Posts:
3
Plugin Contributions:
0

Re: Changing the sort order for order status

Thanks for that very helpful and very specific message DrByte.

I'll provide a rundown of what I did, in case it's of use to anyone looking at this:

  1. Several orders already exist. They had been given the premade 'Delivered' status at one stage;
  2. I wanted 'Delivered' to become 'Dispatched' but couldn't rename it as the order status was "in use" (this is really quite the drawback for this cart solution...);
  3. I created 'Dispatched' manually and added it to the existing orders;
  4. I then removed 'Delivered' from the order_status_history table via PHPMyAdmin so that it was no longer assigned to any existing order;
  5. I then deleted the 'Delivered' order status from within Zen Cart;
  6. I then updated the order_status_id for 'Dispatched' in the order_status table via PHPMyAdmin so that instead of '105' it was '3' (the same as 'Delivered' had been).

Everything seems to be working just fine (e.g. in the main screen showing a rundown of order status, in the individual order history pages, and in the localization pages), except for the pulldown menu which is displaying the order status options in the incorrect order despite the fact they show in the correct order via Localization -> Order Status.

DrByte, do you have any specific suggestions or helpful advice to offer?

16 Jun 2009, 10:39 AM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Changing the sort order for order status

I don't understand why you would have to go that very long dangerous route just to rename an entry.> coldmachineUK:

  1. I wanted 'Delivered' to become 'Dispatched' but couldn't rename it as the order status was "in use" (this is really quite the drawback for this cart solution...
    I'm not sure I understand fully. I just did a fresh clean install of v1.3.8a, placed 4 orders, and used the admin order-edit interface to set each order to a separate order status, making all of them "in use".
    I was then able to go to Localization->Order Status, and could rename the display text on each of them just fine.

I couldn't "Delete" them, but I could certainly click Edit and very easily "Rename" them.

16 Jun 2009, 4:20 PM
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Changing the sort order for order status

coldmachineUK:

... except for the pulldown menu which is displaying the order status options in the incorrect order despite the fact they show in the correct order via Localization -> Order Status.
You can edit /admin/orders.php
Lines 20-22 are similar to the following.
Simply add the text shown in red to cause the same sort order as the localization screen:```
$orders_status = $db->Execute("select orders_status_id, orders_status_name
from " . TABLE_ORDERS_STATUS . "
where language_id = '" . (int)$_SESSION['languages_id'] . "'[B] order by orders_status_id[/B]");

This will only affect the pulldown menu on the Admin->Customers->Orders page.
16 Jun 2009, 4:40 PM
#8
coldmachineuk avatar

coldmachineuk

New Zenner

Join Date:
Jun 2009
Posts:
3
Plugin Contributions:
0

Re: Changing the sort order for order status

Perfect! That works absolutely great, thank you very much for providing that fix, I really appreciate it :smile:

20 Dec 2009, 1:46 AM
#9
ningyotan avatar

ningyotan

New Zenner

Join Date:
Nov 2009
Posts:
56
Plugin Contributions:
0

Re: Changing the sort order for order status

Is there are way to sort them in alphabetical order in the pull down menu rather than the order in which they were created?

Thanks in advance :smile: