Jump to content

Re-order the order status list in the drop down in orders page


stevell

Recommended Posts

I would like to re-order the order status names in the drop down so they follow a logical order.

 

Example

1 Payment Accepted 

2 Preparation in Progress

3 Shipped

4 Delivered

5 Cancelled

 

They are currently in alphanumerical order. I had look but could not see where the code was located for the drop down. 

 

Thanks 

Steve

Link to comment
Share on other sites

There are a few ways to accomplish this

 

1) The OrderState class has a function called getOrderStates, which queries the database for the available order states, and it is this query which orders them by name ascending (alphabetical A-Z). 

 

You could change this function to return them in some other order, but since this function is used throughout the system, it might impact other areas.  You'll need to decide if that is acceptable.

 

2) The AdminOrdersController is what calls the getOrderStates function, and places the result array into the smarty template engine.  So an alternative is for you to re-order the states before placing the array into the smarty engine. 

 

3) You can also alter the template that displays the html content.  That file path is located below.  It just iterates through the array and displays them in the order provided to it.  So you could alter this file to place them in your desired order.  Or you could completely ignore the array, and just provide the select element with the options you want to show here, in the order you prefer.

admin\themes\default\template\controllers\orders\helpers\view\view.tpl

  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...