Variant Title Not Showing Correctly On Order Printer

Our product variant title was originally named “100g x 3” but updated to “100g x 16”.

In our Shopify order dashboard, the orders containing this item are showing the variant as “100g x 3”. However in the Order Printer template, it is showing as “100g x 16”. This had caused our team to pack 16 units instead of 3 units.

We’re using the syntax {{ line_item.variant.title }} in our Order Printer template. Has anyone encountered this issue? Is there a way to fix this?

Hello @metaterra Yes, this is a known behavior in Shopify due to how order data is snapshotted at the time of purchase.

Correct way to show historical variant title
Instead of {{ line_item.variant.title }}, use:

{{ line_item.title }}

Why?
line_item.title includes both the product name and the actual variant title at the time of order.

For example:

. Product: “Protein Powder”

. Variant: “100g x 3”

. Result of {{ line_item.title }}: “Protein Powder - 100g x 3”

This is frozen in time and reflects the title when the customer made the purchase.

Fix for Order Printer template:
Replace this:

{{ line_item.variant.title }}

With this:

{{ line_item.title }}

Or if you only want the variant portion without the product title, you can extract it like this:

{{ line_item.title | remove: line_item.product.title | remove: ' - ' }}

This will safely extract just the variant title as it was at time of order.

Summary
. line_item.variant.title = Live / Current variant title

. line_item.title = Frozen title at time of order Use this one

Thank you :blush:

Thank you for your help, @goldi07 !

I used {{ line_item.title | remove: line_item.product.title | remove: ’ - ’ }} and it works perfectly - it took the frozen title instead of the live one.

What about product title? I do not want it to display the variant titles so I modified to {{ line_item.title | remove: line_item.variant.title | remove: ’ - ’ }} but it does not work.