Re: Adding customer total number of orders to packing slip

Adding customer total number of orders to packing slip

LibertineFragra
Tourist
7 0 4

Hello!


I am trying to add a small addition to my packing slips. I would like to show the total number of orders a customer has placed on the packing slip so the person shipping can add in extras based on how much they have ordered in the past. 

I have tried updating the code but didn't get anywhere. I had added in Customer.orders_count as seen below. I get a section that says Orders but no numbers show up beside. If anyone could provide insight if I am missing something or should be using a different tag it would be greatly appreciated.

 

</div>
<p class="text-align-right">
Order {{ order.name }}
</p>
<p class="text-align-right">
{{ order.created_at | date: "%B %e, %Y" }}
</p>
</div>
<div> <p class="text-align-right">
Order {{ customer.orders_count }}
</div>

Replies 7 (7)

SB_90
Shopify Partner
216 52 70

Hi @LibertineFragra 

 

I've just tested and you've got the correct liquid tag:

 

{{customer.orders_count}} 

 

Only thing I can see is  that there's no closing </p> tag after your <p> element to close off that item.

 

So these lines:

 

<div> <p class="text-align-right">
Order {{ customer.orders_count }}
</div>

 

Should actually be:

 

<div> <p class="text-align-right">
Order {{ customer.orders_count }}
</p>
</div>

 

Notice the additional </p> after the {{ customer.orders_count }}.

 

I can't be sure that's exactly what's causing it but the liquid tag works for me!

JHKCreate
Shopify Partner
3571 638 932

@LibertineFragra as per the Shopify documentation, only a few variables are available for the customers: Packing slip variable reference · Shopify Help Center

 

JHKCreate_0-1644256079053.png

 

Order count isn't one of them, so it shouldn't work based on this information above.

 

Did we solve your issue? Like & Mark As Solution to help the community
Should you need any direct help: contact@jhkcreate.com

Learn more about us: jhkcreate.com
LibertineFragra
Tourist
7 0 4

Thanks @JHKCreate 

Regardless of formatting it wasn't working. It looks like this is why. I will move on to try find another solution for this. 


JoesIdeas
Shopify Partner
2477 228 667

@LibertineFragra  I tested this and agree with @JHKCreate's assessment, it looks like it's not possible in packing slips.

 

Here's a solution I think would work:

 

1) Add the customer orders count to the order notes

 

2) Use {{ order.note }} variable in the packing slip (https://help.shopify.com/en/manual/shipping/setting-up-and-managing-your-shipping/packing-slips-vari...)

 

3) Instruct the personal handling the packing slip to look in the notes section

 

For adding the customer orders count to notes, if you're doing low volume you could have someone do a daily task to update each order, and instruct your fulfillment team not to ship orders until that time every day.


If you want to automate that, Order Automator can do that. It's a customizable automation app that handles order processing tasks - if something doesn't work out of the box how you want it contact me (I'm the lead developer of the app) or ask for Joe in the app's support and I'll set you up.

• Creator of Order Automator [auto tag, fulfill, connect FBA, daily jobs]
• Co-Creator of Product Automator [suite of features for products / collections]
• Shopify developer for 10+ years, store owner for 7 years
• Blog: Shopify Tips, Guides, and Automation Tactics

Joderella
Tourist
3 0 3

I use Order Printer to print invoices, and used the code to edit the invoice template, so the order number shows up on the invoice instead of the packing slip.

franzzeq
Tourist
9 1 5

hi there!

 

use this liquid tag and you'll get what you want

 

{{ order.customer.orders_count }}

 

you can thanks me on Instagram! @franzeq :]

WytchWood
Visitor
1 0 0

I added the below and it works:

<div> <p class="text-align-right">
Purchase No. {{ order.customer.orders_count }}
</p>
</div>