My solution would be this:
function get_all_user_data($user_id) {
$user_data = get_userdata($user_id);
$login = $user_data->user_login;
$customer_array = new WC_Customer( $user_id );
$customer = $customer_array->get_data();
$billing_first_name = $customer[billing][first_name];
$shipping_first_name = $customer[shipping][first_name];
}
add_action('user_register','get_all_user_data');
add_action('profile_update','get_all_user_data');
The array setup for the Customer arrays [billing] and [shipping] is as so (you can just change my values and get different data or add more variables if you’d like):
[billing] => Array
(
[first_name] => John
[last_name] => Doe
[company] =>
[address_1] => 1338 Easy St
[address_2] =>
[city] => Oakland
[postcode] => 48094
[country] => US
[state] => CA
[email] => [email protected]
[phone] => 6167783456
)
[shipping] => Array
(
[first_name] => John
[last_name] => Doe
[company] =>
[address_1] => 1338 Easy St
[address_2] =>
[city] => Oakland
[postcode] => 48094
[country] => US
[state] => CA
)