Help! I need to add the prices of the items to the packing slip. I used this as
{{ line_item.shipping_quantity }}x{{ variant.unit_price | money }} What is the variable for the product price? and how do I get it to display?
Topic summary
A user needs to display product prices on packing slips and initially attempted using incorrect Liquid variables.
Solution Provided:
- Use
line_item.quantityandline_item.final_priceinstead of the original approach - Reference the official Shopify Liquid documentation for the
line_itemobject at shopify.dev
Implementation:
The original poster confirmed a working solution using a loop through order.line_items with SKU matching to assign and display the final price using the money filter.
Note: One response claims Shopify doesn’t support this feature and references packing slip documentation, creating some conflicting information despite the confirmed working solution.
Hi, @Nataleigh
You should use line_item.quantity and line_item.final_price
You can refer to the object below.
https://shopify.dev/docs/api/liquid/objects/line_item
Hopefully it will help you. If yes then Please don’t forget hit Like and Mark it as solution!
Looked like this worked perfectly:
{% assign final_price = nil %}
{% for item in order.line_items %}
{% if item.sku == line_item.sku %}
{% assign final_price = item.final_price %}
{% endif %}
{% endfor %}
{% if final_price %}
{{ final_price | money }}
{% endif %}
Hi @Nataleigh ,
Currently, Shopify does not support this, you can refer to the properties here
I hope it helps!