Liquid variables and filters reference for Shopify Order Printer

You can use Liquid to build your own custom templates using the Shopify Order Printer app. With Liquid, you can create text templates and render them based on each order's unique data.

The liquid references listed on this page are an extension of the the open-source version of Liquid and are meant to be used on the Shopify Order Printer app. To render information based on order and shop attributes, you can use the list of objects, tags, and filters from this reference to customize the your templates. You can also use the Admin GraphQL API docs to learn details about object fields.

Using variables and attributes

In the Shopify Order Printer templates, the core data objects are order and shop. You can use order.variable_name to access the order attributes.

The following commonly used order attributes are accessible without the order. prefix:

  • line_items
  • tax_lines
  • fulfillments
  • transactions
  • discounts
  • refunds
  • shipping_methods
  • customer

For example, if you want to access the line items variable, you can use line_items or order.line_items.

Liquid variables available in Shopify Order Printer

The following classes are available. Attributes are listed in the alphabetical order.

Order

The following Order attributes are available in Shopify Order Printer:

  • applied_discount
  • attributes
  • b2b
  • billing_address
  • cancel_reason
  • cancel_reason_label
  • cancelled
  • cancelled_at
  • cart_level_discount_applications
  • checkout_id
  • checkout_payment_collection_url
  • company
  • company_location
  • confirmation_number
  • created_at
  • customer
  • discounts
  • discounts_amount
  • discounts_savings
  • email
  • fees
  • financial_status
  • financial_status_label
  • fulfilled_line_items
  • fulfillment_aborted
  • fulfillment_status
  • fulfillments
  • gateway
  • id
  • item_count
  • landing_site
  • landing_site_ref
  • line_items
  • line_items_subtotal_price
  • location
  • metafields
  • name
  • net_payment
  • note
  • order_name
  • order_number
  • order_status_url
  • payment
  • payment_details
  • po_number
  • refunds
  • requires_shipping
  • shipping_address
  • shipping_method
  • shipping_methods
  • shipping_price
  • shop
  • shop_name
  • subtotal_price
  • tags
  • tax_lines
  • tax_price
  • total_discounts
  • total_price
  • transactions
  • unacceptable_risks
  • unfulfilled_line_items
  • unique_gateways
  • user
  • void_transactions

Shop

Review the following list of Shop attributes that are available in Shopify Order Printer:

  • accepts_gift_cards
  • account_owner
  • allows_discounts
  • checkout
  • checkout_requires_confirmation_step
  • collections_count
  • contact_information
  • currency
  • customer_accounts_enabled
  • customer_accounts_optional
  • description
  • domain
  • email
  • email_accent_color
  • email_logo_url
  • email_logo_width
  • email_marketing
  • enabled_currencies
  • enabled_locales
  • enabled_payment_types
  • features
  • id
  • latitude
  • legal_notice
  • longitude
  • metafields
  • money_format
  • money_with_currency_format
  • name
  • password_message
  • permanent_domain
  • phone
  • policies
  • privacy_policy
  • products_count
  • refund_policy
  • secure_url
  • shipping_policy
  • subscription_policy
  • terms_of_sale
  • terms_of_service
  • types
  • url

LineItem

Review the following list of Line Item attributes that are available in Shopify Order Printer:

  • aggregated_update
  • applied_discounts
  • current_quantity
  • discount_allocations
  • discounts
  • final_line_price
  • final_price
  • fulfillment
  • fulfillment_service
  • gift_card
  • grams
  • groups
  • id
  • image
  • index
  • item_updates
  • json_filter
  • key
  • line_level_discount_allocations
  • line_level_total_discount
  • line_price
  • message
  • options_with_values
  • original_line_price
  • original_price
  • price
  • product
  • product_id
  • properties
  • quantity
  • refunded_quantity
  • requires_shipping
  • selling_plan_allocation
  • sku
  • successfully_fulfilled_quantity
  • tax_lines
  • taxable
  • title
  • total_discount
  • unit_price
  • unit_price_measurement
  • url
  • url_to_remove
  • variant
  • variant_id
  • vendor

Fulfillment

Review the following list of Fulfillment attributes that are available in Shopify Order Printer:

  • created_at
  • estimated_delivery_at
  • fulfillment_line_items
  • item_count
  • line_items
  • requires_shipping
  • tracking_company
  • tracking_number
  • tracking_numbers
  • tracking_url
  • tracking_urls
  • updated_at

Address

Review the following list of Address attributes that are available in Shopify Order Printer:

  • address1
  • address2
  • city
  • company
  • country
  • country_code
  • country_upper
  • errors
  • first_name
  • id
  • last_name
  • name
  • phone
  • province
  • province_code
  • street
  • summary
  • translated_country_name
  • translated_province_name
  • url
  • zip

Customer

Review the following list of Customer attributes that are available in Shopify Order Printer:

  • accepts_marketing
  • account_activation_url
  • addresses
  • addresses_count
  • b2b?
  • default_address
  • email
  • first_name
  • has_account
  • id
  • last_name
  • last_order
  • metafields
  • name
  • new_address
  • orders
  • orders_count
  • payment_methods
  • phone
  • reset_password_url
  • subscribe_url
  • tags
  • tax_exempt
  • total_spent

Discount

Review the following list of Discount attributes that are available in Shopify Order Printer:

  • amount
  • code
  • free_shipping_discount
  • id
  • savings
  • title
  • total_amount
  • total_savings

Product

Review the following list of Product attributes that are available in Shopify Order Printer:

  • as_json
  • available
  • collections
  • compare_at_price
  • compare_at_price_max
  • compare_at_price_min
  • compare_at_price_varies
  • content
  • created_at
  • description
  • featured_image
  • featured_media
  • first_available_variant
  • gift_card?
  • handle
  • has_only_default_variant
  • id
  • images
  • json_filter
  • media
  • metafields
  • object_type
  • options
  • options_by_name
  • options_with_values
  • price
  • price_max
  • price_min
  • price_varies
  • published_at
  • requires_selling_plan
  • selected_or_first_available_selling_plan_allocation
  • selected_or_first_available_variant
  • selected_selling_plan
  • selected_selling_plan_allocation
  • selected_variant
  • selling_plan_groups
  • tags
  • template_suffix
  • title
  • type
  • url
  • variants
  • vendor

Variant

Review the following list of Variant attributes that are available in Shopify Order Printer:

  • as_json
  • available
  • barcode
  • compare_at_price
  • featured_image
  • featured_media
  • id
  • image
  • incoming
  • inventory_management
  • inventory_policy
  • inventory_quantity
  • json_filter
  • metafields
  • next_incoming_date
  • option1
  • option2
  • option3
  • options
  • price
  • product
  • requires_selling_plan
  • requires_shipping
  • selected_selling_plan_allocation
  • selling_plan_allocations
  • sku
  • store_availabilities
  • taxable
  • title
  • unit_price
  • unit_price_measurement
  • url
  • weight
  • weight_in_unit
  • weight_unit

Refund

Review the following list of Refund attributes that are available in Shopify Order Printer:

  • amount
  • created_at
  • id
  • note
  • refund_line_items
  • restock
  • transactions

ShippingLine

Review the following list of Shipping Line attributes that are available in Shopify Order Printer:

  • handle
  • id
  • original_price
  • tax_lines
  • title

TaxLine

Review the following list of Tax Line attributes that are available in Shopify Order Printer:

  • price
  • rate
  • rate_percentage
  • title

Transaction

Review the following list of Transaction attributes that are available in Shopify Order Printer:

  • amount
  • buyer_pending_payment_instructions
  • buyer_pending_payment_notice
  • created_at
  • gateway
  • gateway_display_name
  • id
  • kind
  • name
  • payment_details
  • receipt
  • show_buyer_pending_payment_instructions
  • status
  • status_label

Metafield

A metafield attached to a parent object. To learn about how to access a metafield on a specific object, refer to Access metafields.

Metafields support multiple data types, which determine the kind of information that's stored in the metafield. To access metafields, the access path for metafields consists of two layers:

  • namespace - a grouping of metafields to prevent conflicts,
  • key - the metafield name.

Given this, you can access the metafield object with the following syntax: {{ resource.metafields.namespace.key }}.

Naming: <object>.metafields.<namespace>.<key>. For example, order.metafield.shipping.express_delivery_status

Types:

  • String
  • Array - use [ ] to index. For example, order.metafield.shipping.express_delivery_status[0]
  • Integer
  • Boolean
  • Date

Note Metaobject type isn't supported.

Objects that support metafields:

  • Order
  • Customer
  • Product
  • Variant
  • Location

Liquid filters available in Shopify Order Printer

Usage

To apply filters to an output, add the filter and any filter parameters within the output's curly brace delimiters {{ }}, preceded by a pipe character |. In the example below, product is the object, title is its property, and upcase is the filter being applied:

{{ product.title | upcase }}

If product.title has the Health potion value, HEALTH POTION will be the output from the upcase filter.

Refer to the Filters section from the Shopify Themes Liquid reference for details on how to use Liquid filters.

Filters to be applied on Address objects

  • format_address

For usage examples, refer to the Shopify Themes Liquid documentation for format_address.

Filters to be applied on any text / string

  • camelcase
  • camelize
  • encode_url_component
  • format_code
  • handle
  • highlight
  • pad_spaces
  • paragraphize
  • pluralize
  • url_escape
  • url_param_escape

For usage examples, refer to the Shopify Themes Liquid documentation for string filters.

Filters to be applied on money-meaning numbers

  • money
  • money_with_currency
  • money_without_currency
  • money_without_trailing_zeros

For usage examples, refer to the Shopify Themes Liquid documentation for money filters.

Filters to be applies to convert objects to json

  • json

For usage examples, refer to the Shopify Themes Liquid documentation for json filters.

Filters to be applied on weight-meaning numbers

  • weight
  • weight_with_unit

For usage examples, refer to the Shopify Themes Liquid documentation for weight with unit.

Filters to be applied on tags

  • highlight_active_tag
  • link_to_add_tag
  • link_to_remove_tag
  • link_to_tag

For usage examples, refer to the Shopify Themes Liquid documentation for tag filters.

Filters to be applied on urls

  • article_img_url
  • asset_img_url
  • asset_url
  • cdn_asset_url
  • collection_img_url
  • file_img_url
  • file_url
  • global_asset_url
  • image_url
  • img_tag
  • img_url
  • link_to
  • payment_icon_png_url
  • payment_type_img_url
  • payment_type_svg_tag
  • placeholder_svg_tag
  • product_img_url
  • script_tag
  • shopify_asset_url
  • stylesheet_tag

For usage examples, refer to the Shopify Themes Liquid documentation for media and html filters.

Filters to be applied on collections

  • link_to_type
  • link_to_vendor
  • sort_by
  • url_for_type
  • url_for_vendor
  • within

For usage examples, refer to the Shopify Themes Liquid documentation for collection filters.

Ready to start selling with Shopify?Try it free