I hope someone can help me!
I'd like to change the customer name order in woocommerce in dashboard.
I use this code and it's works fine but the billing and shipping order name is still in the wrong order:
function wp_update_display_name ( $user_login, $user ) {
$user_info = get_userdata($user->ID);
$first_name = $user_info->first_name;
$last_name = $user_info->last_name;
wp_update_user(array('ID' => $user->ID, 'display_name' => $last_name . ' '. $first_name));
}
add_action('wp_login', 'wp_update_display_name', PHP_INT_MAX, 2);
I use a billing software which is connected to Woo via API. The name order is in the wrong order in the billing software too.
Edit: Present state is [firstname] [lastname]. I live in Hungary where the order is [lastname] [firstname].
Please help me, Benjamin