Skip to content

Dynamic text examples

Copy any of these into a text field that supports dynamic text, then change the numbers and wording to suit your store. Each example notes which block it’s written for. Most also work in content blocks, where toMoney doesn’t need currencyCode and remaining(75) gives the amount left to a goal.

Amount left to spend. For an older Progress bar (cart totals), Text, or Banner block (a Progress bar has {{remaining}} for this, converted between currencies), with a free shipping threshold of 75 in the customer’s currency:

{{ orderSubtotal < 75 ? `You're ${toMoney(75 - orderSubtotal, currencyCode)} away from free shipping` : "You've unlocked free shipping!" }}

Text inside {{ }} goes in quotes. If the text contains an apostrophe, use double quotes "…" or backticks `…` around it, as above.

For a progress bar, you can use separate Text (when in progress) and Text (when complete) fields instead, and keep each one simple:

Spend {{ toMoney(75 - orderSubtotal, currencyCode) }} more for **free shipping**
{@discountIcon} **Free shipping unlocked!**

By weight, in the Progress bar (cart weight) block:

Your order weighs {{ totalWeight }} kg. Orders under 20 kg ship free.

Total saved on the order. Text or Banner block:

You're saving {{ toMoney(cartCompareAtPrice - orderSubtotal, currencyCode) }} on this order

Show it only when there’s something saved:

{{ cartCompareAtPrice > orderSubtotal ? `You're saving ${toMoney(cartCompareAtPrice - orderSubtotal, currencyCode)}` : '' }}

Saved on one line item. Line item text block, placed under each line item:

You saved {{ toMoney((compareAtPrice - price) * lineQuantity, currencyCode) }}

Total discounts applied. Text block:

Discounts applied: {{ toMoney(totalDiscountAmount, currencyCode) }}

Percent-off badge. Line item text block:

{@discountTag {{ Math.round((compareAtPrice - price) / compareAtPrice * 100) }}% OFF}

Add the condition Target line item compare-at price greater than price so the badge only shows on items that are on sale. See target conditions.

Original price, crossed out. Line item text block:

Was {@strikethrough {{ toMoney(compareAtPrice, currencyCode) }}}

All of these are for the Line item text block, placed under each line item.

SKU, only when the variant has one:

{{ variantSku ? `SKU: ${variantSku}` : '' }}

A product metafield, such as custom.care_instructions:

{{ line?.product?.metafields?.custom?.care_instructions }}

A variant metafield with a label, only when set:

{{ line?.variant?.metafields?.custom?.lead_time ? `Ships in ${line.variant.metafields.custom.lead_time}` : '' }}

A line item property, such as an engraving:

{{ line.attributes['Engraving'] ? `Engraving: "${line.attributes['Engraving']}"` : '' }}

Final sale notice with an explanation:

{@!tooltip This item can't be returned or exchanged.} {@boldRed Final sale}

Delivery estimate for the chosen shipping method. Text block:

{{ selectedDeliveryOptionLowerEstimate ? `Arrives in ${selectedDeliveryOptionLowerEstimate}–${selectedDeliveryOptionUpperEstimate} days` : '' }}

The chosen shipping method’s description:

{{ selectedDeliveryOptionDescription || '' }}

A value from the customer’s checkout_buddy.field metafield, such as a loyalty tier. Text block:

{{ customer?.metafields?.checkout_buddy?.field ? `Your member tier: ${customer.metafields.checkout_buddy.field}` : '' }}
Questions? [Call us](tel:+15555550123) or [email us](mailto:help@example.com).
By placing your order you agree to our [terms of service](https://example.com/policies/terms-of-service) and [refund policy](https://example.com/policies/refund-policy).
Need help choosing? See our [size guide]<Our sizes run small. If you're between sizes, size up.>

Different text for big orders:

{{ orderTotal > 500 ? 'Your order qualifies for **white-glove delivery**.' : 'Orders over $500 get white-glove delivery.' }}

Quantity-based message, Line item text under each line:

{{ lineQuantity >= 6 ? '{@discountTag Case price applied}' : '' }}

For anything more than a simple either/or, consider two blocks with conditions instead. They’re easier to maintain than long expressions.