Order Printer App, adding customer's tags and metafields

Talfo
Shopify Partner
7 0 2

Hi everyone,

I am trying to add customer's tag and metafield information on the invoice template.

I tried this sample code but didn't work.  (no error was shown)

{%- if customer.tags contains "test" -%}
    {%- if customer.metafields.my_fields.test_label -%}
      {{ customer.metafields.my_fields.test_label }}
    {%- endif -%}
{%- endif -%}

Any idea how can I show the metafield value?

Thanks in advance for your help!

Replies 2 (2)

RThomasDesign
Shopify Partner
10 1 1

Late reply but this will work.

 

While customer tags are not accessible in the Order Printer templates, you can access order tags. The best workaround here is to use the Flow app to automatically add a tag to the order based on the customer's tag. 

 

Something like this:

RThomasDesign_0-1708719289750.png

 

Then in the Order Printer template, you can access the order tag:

{% for tag in tags %}
{% if tag == 'problem_customer'%}This is some text.{% endif %}
{% endfor %}

 

Hope this helps someone!