hi
Could you try this code ?
// sort by billing full name using SQL filters
add_filter('woe_sql_get_order_ids_left_joins', function ($joins) {
global $wpdb;
$joins[] = "LEFT JOIN {$wpdb->postmeta} AS billing_last ON (billing_last.post_id = orders.ID AND billing_last.meta_key='_billing_last_name')";
$joins[] = "LEFT JOIN {$wpdb->postmeta} AS billing_first ON (billing_first.post_id = orders.ID AND billing_first.meta_key='_billing_first_name')";
return $joins;
});
add_filter('woe_sql_get_order_ids_fields', function ($fields) {
return "ID AS order_id, CONCAT(billing_first.meta_value,billing_last.meta_value) AS billing_name";
});
add_filter('woe_sql_get_order_ids_order_by', function ($order_by) {
return "ORDER BY billing_name";
});