Jump to content

[PS 1.6.1.17] Sort orders by latest status change in backoffice, not order date


Masteries

Recommended Posts

For example, I select a specific status in the backoffice order page and then I would like to sort the orders by the most recent status change.

Let's say an order was made in July 20th, but there was a status change in July 25th, is there a way to sort it by that?

 

Link to comment
Share on other sites

Possible solution:

Make an override of AdminOrdersController.php located in controllers/admin. Find the line where this starts: "date_add"

add the following below that section:

            'date_upd' => array(
                'title' => $this->l('Most recent status'),
                'align' => 'text-right',
                'type' => 'datetime',
                'filter_key' => 'a!date_upd'
            ),	

This seems to be working but I'm not sure if this is entirely the correct way to do it.

Edited by Masteries (see edit history)
  • Thanks 1
Link to comment
Share on other sites

  • 3 weeks later...
On 8/1/2019 at 1:31 AM, Masteries said:

Possible solution:

Make an override of AdminOrdersController.php located in controllers/admin. Find the line where this starts: "date_add"

add the following below that section:


            'date_upd' => array(
                'title' => $this->l('Most recent status'),
                'align' => 'text-right',
                'type' => 'datetime',
                'filter_key' => 'a!date_upd'
            ),	

This seems to be working but I'm not sure if this is entirely the correct way to do it.

Works perfectly on 1.7.5

Thanks

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...