How can I showing a shipping phone number in customer order page?

Hi All,

I would like to see how can I displaying the shipping phone number in the customer order page?

I tried to add a code

{{ address.phone | format_address }}

or

{{ order.phone | format_address }}

right under the code

{{ order.shipping_address | format_address }}

in main-order.liquid. But it seems I have no luck. How can I display it correctly? I am using the theme Dawn. Thank you.

Hi Woody, welcome to the Shopify Community.

The correct code you’re looking for is

{{ order.shipping_address.phone }}

but its not always the case that a customer will add a different shipping address. The following code will print shipping address’ phone number, if that’s not available then print the billing address’ phone number and if that’s not available, use the customer’s main phone number.

{% liquid
  if order.shipping_address.phone
    echo order.shipping_address.phone
  elsif order.billing_address.phone
    echo order.billing_address.phone
  else
    echo customer.phone
  endif
%}
1 Like

How do I change my shipping details? My information the customer sees when they checkout.