Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
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.
Solved! Go to the solution
This is an accepted solution.
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
%}
This is an accepted solution.
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
%}
How do I change my shipping details? My information the customer sees when they checkout.
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025