Customer's order page
Prerequisites
Instructions
{% comment %}SERIALIZER SNIPPET STARTS HERE{% endcomment %} {% assign tracked_line_items = order.metafields.serializer.properties.value.items | where: 'lineItemId', line_item.id %} {% if tracked_line_items.size > 0 %} {% assign sns = tracked_line_items | where: 'serialNumber' | map: 'serialNumber' %} {% if sns.size > 0 %} <p style="padding-top: 1em"> <small> Serial number(s): {{ sns | join: ', ' }} </small> </p> {% endif %} {% if tracked_line_items[0].warrantyDuration.value > 0 %} <p> <small> Warranty duration: {{ tracked_line_items[0].warrantyDuration.value }} {{ tracked_line_items[0].warrantyDuration.unit }}(s) </small> </p> {% endif %} {% comment %}SERIALIZER CUSTOM FIELDS EXAMPLE STARTS HERE{% endcomment %} {% comment %}I'm using 'batchNumber' as an example - your key may be different{% endcomment %} {% assign line_custom_fields = tracked_line_items | map: 'customFields' %} {% assign my_fields = line_custom_fields | where: 'key', 'batchNumber' %} {% if my_fields.size > 0 %} <p> <small> Batch number(s): {{ my_fields | map: 'value' | join: ', ' }} </small> </p> {% endif %} {% comment %}SERIALIZER CUSTOM FIELDS EXAMPLE ENDS HERE{% endcomment %} {% endif %} {% comment %}SERIALIZER SNIPPET ENDS HERE{% endcomment %}

Last updated