Order printer's Liquid variables and filters
The app provides its own variation of Shopify's Liquid templating language. Please do not confuse it with the variables and filters available in Shopify notifications, storefront's theme, etc.
Variables
The app provides variables derived/enriched from the data available in Shopify APIs. Such variables are prefixed with two underscore symbols "__", e.g. {{ order.__metafields }}. All available variables and their values can be previewed when creating or editing a template.
Order
Admin REST API
The app queries the data from Shopify's Order REST Admin API. The order resource data is available inside the order variable with the same property names as documented in Shopify API's documentation. For example, the order note field that appears in the REST order resource documentation,
can be embedded in your template via {{ order.note }} syntax. Similarly, you could use other fields such as line_items, name, total_price, etc.
Enriched order fields
Order money fields
__total_refunded_set: a total sum of allsubtotal_setwithin all available order refundrefund_line_itemsfor allorder.refunds.__net_payment_set:order.current_total_priceminusorder.total_outstanding.__total_outstanding_set:order.total_outstandingconverted to a Shopify money bag containing amounts in shop and presentment currencies.
Order line_items money fields
__discounted_unit_price_set: order line'sprice_setminus allamount_setfrom line'sdiscount_allocations.__total_discount_set: a sum of all line'sdiscount_allocations'amount_sets.__original_total_set: line'sprice_setmultiplied byquantity.__discounted_total_set:__original_total_setminus__total_discount_set.__current_final_price_set: line's__discounted_unit_price_setmultiplied by line's__current_quantity.
Other order line_items fields
__current_quantity: line item'squantityminus all quantity from line'srefund_line_items.__serializer_items: an array of unique serializer items for that specific order line item sourced for serializer's order metafield. Serializer item contains fields such asserialNumber,warrantyDuration,customFields, etc., which are documented in https://galmis.gitbook.io/serializer-product-tracking/getting-started/development-api-reference/metafields#order.
Other order fields
__metafields- extracted from the Shopify Metafields REST API. Metafields can be accessed viaorder.__metafields.[metafield namespace here].[metafield key here], e.g.order.__metafields.serializer.properties.
Shop
The shop resource is currently limited to the following fields sourced from the Graphql Admin API:
name
contact_email
primary_domain
myshopify_domain
billing_address
Filters
Apart from the filters built in the Liquid language, the app also provides a few convenience filters:
money: formats a presentment (customer's) money field in the format of order'scustomer_locale. The filter accepts Shopify money bag fields, e.g.{{ order.total_price_set | money }}or numeric presentment money equivalent (without the _set), e.g.{{ order.total_price | money }}.format_address: formats an address into an HTML string (similar to Shopify's equivalent filter) with address lines separated by the line break
<br>HTML tag. Example use:{{ shop.billing_address | format_money }}.
Last updated