Change sorting of WooCommerce My account customer orders
The filter hook woocommerce_my_account_my_orders_query
allows to change the 'order'
argument to ASC
(ascending), changing the sorting behavior on My account customer orders list:
add_filter( 'woocommerce_my_account_my_orders_query', 'my_account_orders_query_change_sorting' );function my_account_orders_query_change_sorting( $args ) { $args['order'] = 'ASC'; // Default is 'DESC' return $args;}
Code goes in functions.php file of your active child theme (or active theme). Tested and work.