Shopify themes, liquid, logos, and UX
Good morning,
I am wanting to add the number of orders a customer has placed with us to the order printer template, under their order number and the order date.
I can do the positioning and formatting. Please can somebody help with the code for the number of orders.
Thank you
Solved! Go to the solution
This is an accepted solution.
Hey @TMM2 ,
You can absolutely display the number of orders a customer has placed using Shopify's Order Printer app. The Order Printer template uses Liquid, and luckily, Shopify gives us access to some useful customer data within the order object.
To show the number of orders a customer has placed, you can use:
{% if customer %}
Total Orders by Customer: {{ customer.orders_count }}
{% else %}
Guest Checkout – No order history
{% endif %}
Where to put it:
Since you mentioned you want it under the order number and date, look for this section in your Order Printer template (or something similar):
Order #: {{ order.name }}
Date: {{ order.created_at | date: "%B %d, %Y" }}
And insert your new line right after it:
Order #: {{ order.name }}
Date: {{ order.created_at | date: "%B %d, %Y" }}
{% if customer %}
Total Orders by Customer: {{ customer.orders_count }}
{% else %}
Guest Checkout – No order history
{% endif %}
Let me know if you want to customize the wording or only show it for returning customers.
Best,
Rajat
Shopify Expert
This is an accepted solution.
Hey @TMM2 ,
You can absolutely display the number of orders a customer has placed using Shopify's Order Printer app. The Order Printer template uses Liquid, and luckily, Shopify gives us access to some useful customer data within the order object.
To show the number of orders a customer has placed, you can use:
{% if customer %}
Total Orders by Customer: {{ customer.orders_count }}
{% else %}
Guest Checkout – No order history
{% endif %}
Where to put it:
Since you mentioned you want it under the order number and date, look for this section in your Order Printer template (or something similar):
Order #: {{ order.name }}
Date: {{ order.created_at | date: "%B %d, %Y" }}
And insert your new line right after it:
Order #: {{ order.name }}
Date: {{ order.created_at | date: "%B %d, %Y" }}
{% if customer %}
Total Orders by Customer: {{ customer.orders_count }}
{% else %}
Guest Checkout – No order history
{% endif %}
Let me know if you want to customize the wording or only show it for returning customers.
Best,
Rajat
Shopify Expert
Thank you. That was nice and easy. Really appreciate your help.
Hey @TMM2 Good Morning ☀️,
Here is how you can add the number of orders a customer has placed in the Shopify order template.
{% if customer %}
<p>Total Orders from this Customer: {{ customer.orders_count }}</p>
{% endif %}
You can place this code under the Order Number and Order Template.
It will output you something like this.
Order #: #1005
Date: April 17, 2025
Total Orders from this Customer: 4
Let me know if you mode more help.
Thanks
Thank you. All sorted. Really appreciate it.
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025