How to add customer metadata to my packing slip

How to add customer metadata to my packing slip

Nataleigh
Tourist
4 1 0

I need to add my custom customer metadata to the address section on my packing slip. I have been using the following code: 

{% assign customer.metafields.adv_reg.LICENSE = nil %}
{% if customer.metafields.adv_reg.LICENSE %}
{{ customer.metafields.adv_reg.LICENSE }}
{% endif %}

{% if customer.metafields.adv_reg.LICENSE != blank %}
{{ customer.metafields.adv_reg.LICENSE }}
{% endif %}

Replies 2 (2)

websensepro
Shopify Partner
1288 145 166

Hi @Nataleigh ,

You can use this code:

{% if customer.metafields.adv_reg.LICENSE != blank %}
  {{ customer.metafields.adv_reg.LICENSE }}
{% endif %}

 

This code will check if the Liscene metafield is not blank and display it on the packing slip.

Need a Shopify developer?
Hire us at WebSensePro
For Shopify Design Changes | Shopify Custom Coding | Custom Modifications
Subscribe to our youtube channel or buy us a Cofee here

Free Shopify Beginner Tutorial
Nataleigh
Tourist
4 1 0

Thanks, I tried it and it did not work. Not sure what is going on. The field is active in the customer profile and it has data populated.