Serializer - Product Tracking
  • Getting started
    • Introduction
    • Enable product tracking
    • Add serial numbers and other data to orders
      • Serialize items from the Admin Order page
      • Serialize items via the app (legacy)
    • Add serial numbers to the Shopify POS cart
    • Track items
    • Share item information with customers
      • Shopify notifications
      • Customer's order page
      • Order printer
      • Dynamically display items in your online store
    • Track custom item information
    • Development API reference
      • Metafields
      • App Proxy REST API
      • Order printer's Liquid variables and filters
  • Troubleshooting
    • FAQs
    • Known issues & workarounds
      • Handle external order edits
  • Legal
    • Terms of Service
    • Privacy Policy
    • Sub-processors
Powered by GitBook
On this page
  • Prerequisites
  • Instructions
  1. Getting started
  2. Share item information with customers

Customer's order page

PreviousShopify notificationsNextOrder printer

Last updated 15 days ago

The guide is for illustrative purposes only and requires knowledge of HTML and Liquid. The exact steps depend on your online store's theme and requirements.

Prerequisites

  1. Familiarise yourself with .

  2. (Optional) I recommend and making changes to it first. Once you're happy with the results, please apply the same changes to the live store.

Instructions

  1. Start

  2. Find the relevant customers/order.liquid file. Note that the file name may be different in your store's theme.

  3. Place the code snippet within the order line_items loop to show serial numbers, warranty and custom fields. You may want to edit the snippet for more (e.g. use a custom field key specific to your store).

    {% 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 %}
  4. Click Save and Preview store (buttons at the top right)

  5. Navigate to the customer's order page and verify the changes look as expected. Ensure the order has serial numbers, warranty or custom fields populated. Otherwise you wouldn't see any changes.

    If you don't see any changes even though the order has populated item fields, it's likely the wrong file was edited. Add a dummy code snippet, e.g. <p>Can you see this?</p> to ensure the correct file was edited.

Shopify's theme code editing guide
duplicating your theme
editing your theme code