Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Price and SKU not displayed on all packing slips

Price and SKU not displayed on all packing slips

L8H
Shopify Partner
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
624 60 148

 

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