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.
Free shipping
Section titled “Free shipping”Amount left to spend. For a Progress bar (cart totals), Text, or Banner block, 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.Savings
Section titled “Savings”Total saved on the order. Text or Banner block:
You're saving {{ toMoney(cartCompareAtPrice - orderSubtotal, currencyCode) }} on this orderShow 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) }}Sale badges and old prices
Section titled “Sale badges and old prices”Percent-off badge. Line item text block:
{@discountTag {{ Math.round((compareAtPrice - price) / compareAtPrice * 100) }}% OFF}Add the display rule Target line item compare-at price greater than price so the badge only shows on items that are on sale. See target rules.
Original price, crossed out. Line item text block:
Was {@strikethrough {{ toMoney(compareAtPrice, currencyCode) }}}Product details under a line item
Section titled “Product details under a line item”All of these are for the Line item text block, placed under each line item.
SKU, only when the variant has one:
{{ variantSku && variantSku !== 'undefined' ? `SKU: ${variantSku}` : '' }}A product metafield, such as custom.care_instructions:
{{ line?.product?.metafields?.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
Section titled “Delivery”Delivery estimate for the chosen shipping method. Text block:
{{ selectedDeliveryOptionLowerEstimate ? `Arrives in ${selectedDeliveryOptionLowerEstimate}–${selectedDeliveryOptionUpperEstimate} days` : '' }}The chosen shipping method’s description:
{{ selectedDeliveryOptionDescription || '' }}Customers
Section titled “Customers”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}` : '' }}Contact and policy links
Section titled “Contact and policy links”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.>Conditional messages
Section titled “Conditional messages”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 display rules instead. They’re easier to maintain than long expressions.
