Order PrinterTemplatesLayoutsTags & filters

Tags & filters

Explore order and draft order data: Liquid tags and filters for orders and draft orders.

This tutorial requires the technical skills, including Liquid. If you have difficulty doing this, please contact us.

This article will write all additional filters and tags you can using in the layout. Beside them, you can still use the all default liquid filters and tags.

Tags

Schema

Tag schema helps you to add custom settings to your layout. Please read more from this article.

Filters

compact_number

number | compact_number

Convert a number to compact format. For example, 1000 to 1K, 1000000 to 1M

img_url

"string" | img_url

Add width and height to an image from Shopify CDN.

Prop

Type

The width of the image. This value is in the pixel.
The hright of the image. This value is in the pixel.
Add some additional classes to the generated image URL
The crop parameter allows you to specify which part of the image to show if the specified dimensions result in an aspect ratio that differs from the original. Possible values: top, center, bottom, left, right, region
Use this param if you want to specify the starting point for the crop when the copy param is left
Use this param if you want to specify the starting point for the crop when the copy param is right
Use this param if you want to specify the starting point for the crop when the copy param is top
Use this param if you want to specify the crop width
Use this param if you want to specify the crop height
Specify which file format to use for the image. The valid formats are pjpg and jpg.
Specify a color to pad the image if the specified dimensions result in an aspect ratio that differs from the original. The color must be in hexadecimal format (hex3 or hex6).

img_tag

"string" | img_tag

Convert an image URL to HTML tag.

Prop

Type

The alternative text for the image.
The class name for the image.

bar_code

string | bar_code: width: 2, height: 32, format: "auto", show_value: false

Generate a bar code from a given string.

Prop

Type

The width of the bar code.
The height of the bar code.
The format of the bar code. Possible format: auto, CODE128, EAN13, UPC, EAN8, EAN5, EAN2, CODE39, ITF14, MSI, pharmacode, codabar.
Allow showing a value under the bar code.
Add some additional classes to generated bar code

qr_code

"string" | bar_code: width: 200

Generate a QR code from a given string.

Prop

Type

The width of the QR code.
Add some additional classes to generated QR code

money_format

number | money_format

Format a number as a currency.

Prop

Type

The currency you want to display. For example: USD
The locales you would like to display. Example: en-US
The minimum number of fraction digits to use. Possible values are from 0 to 100

customer_money

MoneyBag | customer_money

Format the price as the currency of the customer.

Prop

Type

The locales you would like to display. Example: en-US
The minimum number of fraction digits to use. Possible values are from 0 to 100

money

(MoneyBag or number) | money

Format the price as the currency of the shop.

Prop

Type

The locales you would like to display. Example: en-US
The minimum number of fraction digits to use. Possible values are from 0 to 100

money_no_decimals

(MoneyBag or number) | money_no_decimals

Format the price as the currency without decimals

money_with_currency

(MoneyBag or number) | money_no_decimals

Format the price as the currency with the currency.

Prop

Type

The minimum number of fraction digits to use. Possible values are from 0 to 100

money_without_currency

(MoneyBag or number) | money_no_decimals

Format the price as the currency without the currency.

Prop

Type

The minimum number of fraction digits to use. Possible values are from 0 to 100

masked_text

"string" | masked_text: remaining: 2

Add * to a string. For example: Andrew Doan will become to An**** **an.

Prop

Type

The remaining characters are in the first and last parts of the string.

t

string | t

Translate a key to multiple language.

Prop

Type

The language code you want to translate.

render_vars

string | render_vars

Render liquid with the given string.