Adding a metafield to the order confirmation email

Highlighted
Shopify Partner
36 0 3

I thought I could just update the order confirmation email template, and underneath  

{% if line.variant_title != 'Default Title' %}
<span class="order-list__item-variant">{{ line.variant_title }}</span><br/>
{% endif %}

 

add 

{% if line.metafields.purchase_code %}
<span class="order-list__purchase-code">{{ line.metafields.purchase_code }}</span>
{% endif %}

 

to show the purchase_code metafield for my product - but it didn't show up in my email.  Where did  I go wrong? 

Long time Zen Cart modder, getting started with Shopify.
0 Likes
Highlighted
Shopify Partner
36 0 3

Is there a way for me to test / debug this short of creating a new order for every test?  (Obviously that's very time consuming.) 

Long time Zen Cart modder, getting started with Shopify.
0 Likes