Results 1 to 9 of 9
  1. #1
    Join Date
    Jan 2006
    Location
    Australia
    Posts
    330
    Plugin Contributions
    0

    Default 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

  2. #2
    Join Date
    Jun 2009
    Posts
    3
    Plugin Contributions
    0

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

  3. #3
    Join Date
    Jan 2006
    Location
    Australia
    Posts
    330
    Plugin Contributions
    0

    Default Re: Changing the sort order for order status

    Quote Originally Posted by coldmachineUK View Post
    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.

  4. #4
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Changing the sort order for order status

    Quote Originally Posted by coldmachineUK View Post
    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.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Jun 2009
    Posts
    3
    Plugin Contributions
    0

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

  6. #6
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default 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.
    Quote Originally Posted by coldmachineUK View Post
    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...
    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.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  7. #7
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Changing the sort order for order status

    Quote Originally Posted by coldmachineUK View Post
    ... 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:
    Code:
      $orders_status = $db->Execute("select orders_status_id, orders_status_name
                                     from " . TABLE_ORDERS_STATUS . "
                                     where language_id = '" . (int)$_SESSION['languages_id'] . "' order by orders_status_id");
    This will only affect the pulldown menu on the Admin->Customers->Orders page.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  8. #8
    Join Date
    Jun 2009
    Posts
    3
    Plugin Contributions
    0

    Default 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

  9. #9
    Join Date
    Nov 2009
    Posts
    56
    Plugin Contributions
    0

    Default 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

 

 

Similar Threads

  1. v151 Product Sort within Category - having problems changing the default sort order
    By Don Wagner in forum Customization from the Admin
    Replies: 4
    Last Post: 21 Oct 2012, 03:03 AM
  2. Changing the text in the Order Status drop down on Edit Order page
    By jcountryman in forum Managing Customers and Orders
    Replies: 3
    Last Post: 15 Oct 2009, 04:34 AM
  3. Changing the Sort Order of sideboxes
    By Drugoholic in forum Customization from the Admin
    Replies: 7
    Last Post: 23 Jun 2009, 04:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg