• Resolved Lars Jansen

    (@lars-2)


    Hello,

    Is it possible to default sort the orders in the backend (/wp-admin/edit.php?post_type=shop_order) by date?
    For some reason it’s sorted by status (finished, failed, in progress) which is quite unhandy.

    I know I can just click on the date heading twice, but that takes quite some time if I need to to that every time.

    Would be very happy to hear from someone soon.

    Kind regards,
    Lars Jansen

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support con

    (@conschneider)

    Engineer

    Hi Lars,

    Is it possible to default sort the orders in the backend (/wp-admin/edit.php?post_type=shop_order) by date?

    The default sort order of orders is date. If it is not for you, something is changing it. You can try and overwrite this behaviour with something like: https://stackoverflow.com/questions/41964737/change-default-sorting-order-in-woocommerce-dashboard-screen

    Please note that we provide no warranty or support for custom code or 3rd party plugins (meaning we cannot not help you further with this code snippet or WordPress.org / GitHub plugins). Use them at your own risk.

    **Also: Before you do that, please do make a full backup!**

    Kind regards,

    Thread Starter Lars Jansen

    (@lars-2)

    Hi Con,

    Thanks for your reply. I’m aware that the default is date, but it simply wasn’t. I also have no clue what plugin could’ve caused it, since I use all the plugins in multiple websites.

    In the end, your stackoverflow link helped a lot!
    I changed the code to this (which works):

    
    if( is_admin() && $_GET['post_type'] === 'shop_order' ){
    	if(!isset($_GET['orderby'])) $_GET['orderby'] = 'date';
    	if(!isset($_GET['order'])) $_GET['order'] = 'desc';
    }
    

    Thanks and have a nice day!

    In our case, it was the order-delivery-date plugin. It changes the sort order on the administrative orders page to be based on the custom delivery date for each order.

    However, the plugin provides a configuration option on its own settings page to enable or disable the custom sorting.

    We were able to identify the causing code by looking at the actual query being executed using the query-monitor plugin.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Order sorting backend’ is closed to new replies.