Skip to main content

Metafields

Written by Haris Spahovic
Updated this week

Using Metafields in Your Templates

Metafields allow you to pull custom data from your Shopify store directly into your documents. Our application currently supports metafields for:

  • Orders

  • Draft Orders

  • Products

  • Variants

  • Customers

Supported Metafield Types

While Shopify offers many data types, our app currently supports:

  • Text Fields:

    • Multi-line test

    • Single line text

    • Rich text

    • Choice list

    • Email

  • Numbers:

    • ID

    • Money

    • Decimal

    • Integer

    • Rating

    • Weight

    • Volume

    • Dimensions

  • Other:

    • True or false

For all the mentioned available types, you can use either One or List.

Unsupported Metafield Types

The following types are not currently supported. If these are used, they may not display or sync as expected:

  • Media

    • File

    • Image

    • Video

  • References

  • Link

    • Link

    • URL

  • Dates & time

    • Date

    • Date and time

  • Advanced

    • JSON

    • Mixed references

  • Other

    • Color


Technical Specifications & Limits

To ensure optimal document generation speed, we have implemented the following limits:

  • Maximum Fields: You can use up to 10 metafields per category (10 for Orders, 10 for Products, and 10 for Variants).
    ​

  • Priority: If you have more than 10 metafields defined in Shopify, the system will only retrieve the first 10, and the remaining metafields will not be recognized or visible.
    Example: If you have 15 metafields on your product(with or without value) app will only recognize the first 10(with or without value).


    Note:
    We currently display the first 10 metafields from your Shopify store. If a specific metafield you need isn't showing up because it's further down the list (e.g., in the 15th spot), you can easily fix this! Just go to your Shopify Admin, drag and drop that specific metafield into one of the top 10 positions, and it will immediately become visible and supported in our app. However, it will push down the last one that was previously in the first 10.


How to Implement Metafields

To display a metafield, you must use the correct Liquid syntax and place it within the appropriate section of your template.
​

1. Product Metafields

Product metafields must be placed within the line_item loop of your template.

  • Base Syntax: {{ line_item.product.metafields.NAMESPACE.KEY }}

  • Example: For a single-line text field called "Product Description" (Namespace: custom, Key: product_description):

    {{ line_item.product.metafields.custom.product_description }}

2. Variant Metafields

Useful for specific item details like "Material" or "Size Guide."

  • Base Syntax: {{ line_item.variant.metafields.NAMESPACE.KEY }}

3. Order and Draft Order Metafields

These apply to the entire order rather than specific items.

  • Base Syntax: {{ order.metafields.NAMESPACE.KEY }}

4. Customer Metafields

  • Base Syntax: {{ customer.metafields.NAMESPACE.KEY }}


Using Complex Metafields (Money, Weight, etc.)

Some metafield types are stored as "objects." To display them correctly in your templates, you must specify whether you want the numerical value or the unit (like USD or kg). Please make sure to use the correct syntax.
​

πŸ’° Money

To show the amount followed by the currency code:

{{ order.metafields.custom.money_metafield.value }}

{{ order.metafields.custom.money_metafield.unit }}

(Example: 50.00 USD)
​

βš–οΈ Weight, Volume, & Dimensions

For measurements, use the .value for the number and .unit for the measurement type:

  • Weight:

    {{ order.metafields.custom.weight_metafield.value }}

    {{ order.metafields.custom.weight_metafield.unit }}

  • Volume:

    {{ order.metafields.custom.volume_metafield.value }}

    {{ order.metafields.custom.volume_metafield.unit }}

  • Dimensions:

    {{ order.metafields.custom.dimensions_metafields.value }}

    {{ order.metafields.custom.dimensions_metafields.unit }}

⭐ Ratings

Ratings require you to pull the current value and the maximum possible scale:

{{ order.metafields.custom.raiting_metafield.value }} of {{ order.metafields.custom.raiting_metafield.scale_max }}
​(Example: 4.5 of 5)


Pro Tip: Always double-check your metafield "Namespace and Key" (e.g., custom.money_metafield) to ensure it matches your specific settings exactly.


Quick Reference Table

Category

Liquid Syntax Path

Order

order.metafields.namespace.key

Product

line_item.product.metafields.namespace.key

Variant

line_item.variant.metafields.namespace.key

Did this answer your question?