Supported Liquid syntax for blocks in Checkout Blocks
Checkout Blocks supports a subset of Liquid syntax that you can use in several of the available block types to personalize your checkout customizations based on variables.
On this page
Supported Liquid variables
The following lists include all supported Liquid variables that can be used within a Dynamic content block or Line item content block. Some variables are accessible only on certain pages of checkout, and other variables can be included only in specific block types.
Refer to Shopify's Liquid objects documentation for specifics on each variable.
Checkout Liquid variables
The following Liquid variables are supported for the checkout:
-
checkout.attributes
-
checkout.currency
-
checkout.has_selling_plan
-
checkout.item_count
-
checkout.line_items_subtotal_price
-
checkout.locale
-
checkout.market
-
checkout.metafields
-
checkout.note
-
checkout.requires_shipping
-
checkout.shipping_price
-
checkout.tax_price
-
checkout.total_price
Customer Liquid variables
The following Liquid variables are supported for customers:
-
customer.id
-
customer.b2b
-
customer.full_name
-
customer.first_name
-
customer.last_name
-
customer.email
-
customer.phone
Localization Liquid variables
The following Liquid variables are supported for markets:
-
localization.market
-
localization.market.id
-
localization.market.handle
-
Order Liquid variables
The following Liquid variables are supported for orders:
-
checkout.order.id
-
checkout.order.legacyResourceId
-
checkout.order.name
Shop Liquid variables
The following Liquid variables are supported for store information:
-
shop.name
-
shop.url
Line item Liquid variables
The following Liquid variables are supported for line items:
-
line_item.attributes
-
line_item.gift_card
-
line_item.has_selling_plan
-
line_item.line_price
-
line_item.line_level_discount_allocations
-
line_item.line_level_total_discount
-
line_item.options_with_values
-
line_item.price
-
line_item.product
-
line_item.product.is_gift_card
-
line_item.product.product_type
-
line_item.product.requires_selling_plan
-
line_item.product.tags
-
line_item.product.vendor
-
-
line_item.quantity
-
line_item.requires_shipping
-
line_item.sku
-
line_item.subtitle
-
line_item.title
-
line_item.trigger
-
line_item.type
-
line_item.variant
-
line_item.variant.available_for_sale
-
line_item.variant.barcode
-
line_item.variant.compare_at_price
-
line_item.variant.id
-
line_item.variant.price
-
line_item.variant.price.amount
-
line_item.variant.price.currency_code
-
-
line_item.variant.requires_shipping
-
line_item.variant.sku
-
line_item.variant.title
-
line_item.variant.unit_price
-
line_item.variant.weight
-
line_item.variant.weight_unit
-
-
line_item.variant_id
-
line_item.vendor
Examples of snippets using Liquid
The following are some example Liquid snippets supported by Checkout Blocks.
Check if checkout is B2B
You can display content only when the checkout is B2B.
Parse JSON
You can parse JSON values, such as from line item attributes (properties) or metafields.
Format currency
Checkout Blocks fully supports multi-currency checkout. Simply pass the money filter to parse and format money using the active currency format. This doesn't automatically convert the currency.
Cart note
You can display the value of the cart note, such as what was entered on the cart.
Cart attributes
To display the value of a particular cart attribute, such as a delivery date, you can use this snippet. Be sure to change the key Delivery date to match your own.
Display entire checkout Liquid contents
If you need to review what values exist on the checkout object, then you can using JSON filter to serialize. This should only be used for debugging purposes.
Checkout metafields
You can display custom fields saved to checkout on the thank you and order status pages by referencing the checkout metafields. Learn more about accessing metafields.
Replace your-namespace
with your namespace and your-custom-field-key
with your custom field key as defined on the block:
Format a date
In this example, we create a date 4 days in the future (432000 seconds) and then format it.
You can return the date formatted as "02/24/2025":
Alternatively, you can format the date as "Feb 24, 2025":
Learn more about formatting dates in Liquid.
Line item content customizations
The following are some example Liquid snippets you can use on Line item content blocks.
Conditionally show the compare at price
You can conditionally show a line item's compare at price using this snippet.
Display content based on product tags
You can conditionally display line item content based on the product tags, which are case sensitive.
Line item attributes (properties)
You can iterate over line item attributes, also known as line item properties, and display information such as delivery estimates, pre-orders, and more.
Display the "metafield trigger" value
The following code will contain the value of the trigger.
Show recurring total for a line item
If you need to show the recurring total for a subscription line item before one-time discounts, then you can use the line_level_total_discount
value.