How to echo billing phone number under My Account in Woocommerce? [closed]

We’re wish to get customer’s billing_phone number & then put it under “My Account” or “My Address” section.

This way, our billing support can look up for a number to call from the front-end, w/o navigating into order management.

Tried using phone' => get_user_meta( $customer_id, $name . '_phone', true ) in my-address.php, but that isn’t working.

Any leads? Thank you.

1 Answer
1

You’re close – just need to tweak your arguments:

<?php echo get_user_meta( $customer_id, 'billing_phone', true ) ?>

Just make sure $customer_id is the ID of the user – you probably want get_current_user_id() instead.

Leave a Comment