We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Order Email Templates - Accessing Metaobject Data inside an Order Metafield

Order Email Templates - Accessing Metaobject Data inside an Order Metafield

benmay_sofsy
Not applicable
2 0 2

Hello,

 

  1. I have setup an Order Metafield definition.
  2. This metafield is setup with content type - Metaobject
    • Only one entry is allowed for this metafield
  3. The referenced Metaobject has 4 fields as shown below
  4. I want to output the values from the metaobject inside of the Order Notifications Email Template

The following outputs the GID value of the Metaobject from the Metafield.

 

{% if order.metafields.meta.assigned_concierge_team_member %}
  {% assign concierge_handle = order.metafields.meta.assigned_concierge_team_member %}
  <p>Concierge Handle: {{ concierge_handle }}</p>
{% else %}
  <p>No Concierge Handle Assigned</p>
{% endif %}

 

The following code fails to output the values of the metaobject fields

 

{% if order.metafields.meta.assigned_concierge_team_member %}
  {% assign concierge_handle = order.metafields.meta.assigned_concierge_team_member %}
<p>Concierge Handle: {{ concierge_handle }}</p>
<p>First Name: {{ concierge_info.first_name.value }}</p>
  <p>Last Name: {{ concierge_info.concierge_team_member.last_name.value }}</p>
  <p>Role Title: {{ concierge_info.concierge_team_member.role_title.value }}</p>
  <p><img src="{{ concierge_info.concierge_team_member.profile_picture.value | img_url: '300x300' }}" alt="Concierge Profile Picture"></p>
{% else %}
  <p>No Concierge Handle Assigned</p>
{% endif %}

 

Reply 1 (1)

theshirya-1r
Shopify Partner
2 0 0