How to insert product metafields into packing slips on Order Printer?

How to insert product metafields into packing slips on Order Printer?

Ksoldier
Excursionist
47 0 4

I am trying to get the product metafield "custom.bin_location" into the order printer app for the packing slips but any of the existing forums solutions don't appear to be working.

 

I have tried 

 

 

    {% for line_item in line_items %}
        <td>{{ line_item.product.metafields.custom.bin_location }}</td>
    {% endfor %}

 

 

Does anyone know if/how to get product metafields into the packing slips. Thanks

 

Kstuff_0-1692938495450.png

 

Reply 1 (1)

raffx
Shopify Partner
1 0 0

This should work for you:

{% for line_item in line_items %} 
<td>{{ line_item.product.metafields.bin_location.value }}</td>
{% endfor %}

or if the metafield is on the variant level:

{% for line_item in line_items %}
<td>{{ line_item.variant.metafields.bin_location.value }}</td>
{% endfor %}