Metafields help you to customize the functionality and appearance of your Shopify store by letting you save specialized information that isn't usually captured in the Shopify admin. You can use metafields for internal tracking, or to display specialized information on your online store in a variety of ways. For example, a candle seller might want to display a burn time for candles on their product pages, while a grocery store might want to display a product expiration date for canned goods. Other examples of specialized information include the following:
- part numbers
- colour swatches
- launch dates
- related products
- blog post summaries
- files for download
- lists of ingredients
You can add metafields to your products, collections, customers, orders, and other parts of your store, directly from your Shopify admin.
In Xporter, you can add metafields in two ways:
1. From the Shopify Field Browser :
The simplest way is to add the metafield from the Shopify Field Browser -
2. By adding a custom liquid filter :
If you know the Key or namespace of the metafield you can use the pluck filter to extract the metafield-
Some commonly use pluck commands -
To pluck order metafields -
{{order.metafields | pluck: 'key', 'METAFIELD NAME GOES HERE', 'value' }}
To pluck product metafield in an Order report -
Main row should be order.line_item and add the following code as a custom liquid field
{{ line_item.product.metafields | pluck: 'key', 'METAFIELD NAME GOES HERE', 'value' }}
To pluck Product metafields in a product report -
{{ product.metafields | pluck: 'key', 'METAFIELD NAME GOES HERE', 'value' }}
To pluck Customer metafield in an Order Report -
{{order.customer.metafields | pluck: 'key', 'METAFIELD NAME GOES HERE', 'value' }}
To pluck Customer metafield in a Customer report -
{{customer.metafields | pluck: 'key', 'METAFIELD NAME GOES HERE', 'value' }}
If you are having any trouble getting your fields showing up in your report, please don't hesitate to drop us a line at exports@moddapps.com, and we'd be happy to help you set up your report.