Use dynamic variables
Reference for dynamic variables that auto-populate text badges with live product and customer data.
Dynamic variables insert live product, inventory, and customer data into your text badges. Instead of writing a static message like "20% Off," use {sale} and the badge automatically shows the correct discount percentage for each product.
Available variables
{sale}
Discount percentage off the compare-at price
25%
{sale_amount}
Discount amount off the compare-at price
$10.00
{inventory}
Total items available in inventory
12
{product_vendor}
Product vendor
Nike
{product_type}
Product type
T-Shirt
{product_sku}
Product SKU
SKU-12345
{product_variant_count}
Number of variants
5
{customer_order_total}
Customer's total order count
8
{customer_spent_total}
Customer's total spend
$450.00
{countdown}
Countdown based on the visibility date; choose Style 1 or Style 2 before copying
12Days 20Hrs 50Mins
{product_metafield}
Value from a selected product metafield
Organic Cotton
{variant_metafield}
Value from a selected variant metafield
Size EU 42
How to insert a variable
Configure the variable if needed
Most variables are ready to copy immediately. These variables have additional options:
Sale variables — For
{sale}or{sale_amount}, enable the corresponding Hide label if the product/variant is not on sale option when the badge should disappear for full-price products.Product or variant metafield — Expand
{product_metafield}or{variant_metafield}, click Add metafield, then select a metafield from the dropdown.Countdown — Under
{countdown}, choose Style 1 or Style 2 before copying the token.

Copy and paste the token
Click Copy beside the variable. The Variables dialog closes after copying. Click the desired location in the rich text editor, then paste the token into your badge message.
For example, paste {inventory} into Only {inventory} left! or {sale} into Save {sale}!.

You can also type a standard token such as {sale} or {inventory} directly into the editor. Type it exactly as shown, including the curly braces. Use Insert Dynamic Text for metafields and countdown styles so the app can generate the correct token.
Important notes
Variables are case-sensitive. Type or paste them exactly as copied, including the curly braces. For example, {sale} works, while {Sale} and {SALE} do not.
Example use cases
Here are some common ways merchants use dynamic variables in their text badges:
Save {sale}!
Save 25%!
Highlight the discount percentage on sale items
Only {inventory} left!
Only 3 left!
Create urgency with low-stock warnings
Ships from {product_vendor}
Ships from Nike
Show the product vendor for multi-vendor stores
{product_variant_count} options available
5 options available
Let customers know a product comes in multiple variants
{countdown} left!
2d 05h 30m left!
Create urgency with a countdown to the end of a sale
VIP: {customer_order_total} orders
VIP: 8 orders
Reward loyal customers with personalized badges
You have spent {customer_spent_total}
You have spent $450.00
Show customers their spending history for loyalty programs
Next steps
Dynamic variables reference — Review the complete variable list and availability notes.
Create a text badge — Build a text badge and insert dynamic variables.
Schedule badge visibility — Set start and end dates to control when badges appear, and pair with the countdown variable.
Target products — Control which products display each badge using conditions.
Need support?
If you run into any difficulty while following these steps, contact us at support@samita.io.
Last updated
Was this helpful?


