New Shopify Certification now available: Liquid Storefronts for Theme Developers

What variable is holding this phone number?

BenParnell
Tourist
3 0 1

Hello,

 

I am working on custom invoices using the Order Printer app and came across an instance that is giving me an issue.  In our workflow the invoice is printed, used for picking-packing-shipping label creation, and then sent to Accounting. We want to add the customer's phone number, in case the picker needs to contact them about substitutions, etc. 

I have built my template to display as many iterations of phone numbers as I could find (and a few I couldn't but guessed at) but have not figured out how to get this number to appear:

BenParnell_0-1608227962928.png

 

This number was added to the order when it was placed: 

BenParnell_1-1608228043104.png

 

So far I am using these variables:

{{ billing_address.phone }}
{{customer.phone}}
{{ customer.default_address.phone }}
{{phone}}
{{ transaction.phone }}
{{ order.phone }}
{{ order.customer_phone }}
{{ form.phone }}
{{ shipping_address.phone }}
 
This customer has an account with us, but did not add their phone number to their contact info.  
 
Any help would be greatly appreciated! Let me know if there is anything else I can provide!
Replies 8 (8)
JoesIdeas
Shopify Expert
2039 184 537

Good tries, so close!

I believe {{ order.customer.phone }} will do it for you. (assuming you're referencing using Liquid in the order notification emails)

Or if you want the phone for shipping address: {{ shipping_address.phone }}

Reference: https://help.shopify.com/en/manual/orders/notifications/email-variables

• Creator of Order Automator (automate tagging, fulfillment, Amazon, notifications + more)
• Shopify developer for 10+ years, store owner for 7 years
• I also make guides like Shopify Automation Tips and How to Deal with Fraud / Chargebacks
BenParnell
Tourist
3 0 1

Thanks for responding, but unfortunately that's not it.

JoesIdeas
Shopify Expert
2039 184 537

That's straight from the Shopify documentation. If it's not working for your situation, I recommend:

1) Identify where you're at in Shopify (notifications, theme editor, etc).

2) Look up the documentation for available liquid objects in that section of Shopify.

3) Get the variable from the documents and add it to your code.

4) Identify what you mean by "that's not it". If you mean you're getting an error, you have the wrong variable. If you're getting no data, check the object you're referencing actually has data populated, etc.

 

Those debugging steps will lead you to solve your problem. Alternatively you can hire a developer to handle it for you. We do stuff like this every day and can figure out the issue for you.

• Creator of Order Automator (automate tagging, fulfillment, Amazon, notifications + more)
• Shopify developer for 10+ years, store owner for 7 years
• I also make guides like Shopify Automation Tips and How to Deal with Fraud / Chargebacks
BenParnell
Tourist
3 0 1

Thank you so much for trying to help me.

I'm in the Order Printer and have already used all of the Liquid variables that have anything to do with a phone number. 

In doing my research I found other variables that isn't in their documentation, at least the documentation that I could find.  I didn't see a reference to "order.customer.phone" on your linked Reference page, so maybe I'm just looking in the wrong places.

I don't get any errors when I save my templates, but I also don't get that phone number to populate on my orders.  This is such a simple thing that I shouldn't need to contract-out the last detail. 

BCDelivery
Visitor
1 0 1

We need the same thing. We tried everything the in liquid documentation source to no avail

XxDrAg0nxX
Tourist
8 0 1

did anyone manage to figure this out please

mudie3309
Visitor
2 0 0

Same issue...

JW83
Visitor
1 0 0

Same issues here... 
Anyone figure this one out?