Price and SKU not displayed on all packing slips

Price and SKU not displayed on all packing slips

L8H
Visitor
1 0 0

We are using this code to get price and sku to show on our packing slips for each item in the order. However sometimes sku is not displayed and sometimes prices in not displayed. Sometimes the price is 0 aswell. I cannot find any reason when looking at the products for this. Is there a solution to this?

 

"{% assign final_price = nil %}

{% assign line_name = line_item.title %}

{% if line_item.variant_title != blank %}

{% assign line_name = line_name | append: " - " | append: line_item.variant_title %}

{% endif %}

{% for item in order.line_items %}

{% assign order_name = item.title %}

{% if order_name == line_name %}

{% assign final_price = item.final_price %}

{% endif %}

{% endfor %}

{% if final_price %}

{{ final_price | money }}

{% endif %}"

Reply 1 (1)

PaulMartin
Shopify Partner
251 39 72

 

There is no line_item.variant_title, use line_item.variant.title instead. Then try again.

Open to help people out, just email me here or tag me by using "@" when posting your comment