I Would like in my WooCommerce web shop to show registered user phone, but dont know how to do that. I Read all themes that i found on StackOverflow for that, but none of suggested solutions, dont resolved my issue.
I have tried inserting this:
'billing_phone' => get_user_meta( $customer_id, $name . '_phone', true ),
inserting into
/woocommerce/templates/myaccount/my-address.php
But still user phone not shown in my-account
page.
Can someone give me some tips, how to resolve this issue?
Thanks.
To get the customer phone you need the correct meta_key
is 'billing_phone'
in wp_usermeta
table, so your code will be:
$customer_phone = get_user_meta( $customer_id, 'billing_phone', true );
// Displaying customer phone:
echo '<br>'; # Going on line below
echo __('Phone: ', 'woocommerce') . $customer_phone;
This surely will work