Text variables
Applies to: TreStack Bundles, every plan
Updated: 5 November 2026
- Insert one: Insert variable, beside a text field
- Prices: In the shopper's currency, with your money format
- Unknown variable: Prints nothing
What a variable does
A variable is a word in double braces, such as {{saved_percentage}}, that the widget replaces with a real value for the bar the shopper is looking at. Buy 3, save {{saved_percentage}} shows as "Buy 3, save 15%" and changes by itself when you change the discount or the product's price.
Texts that take variables have an Insert variable button beside the field. It opens a menu of the variables that field can use and puts the one you choose where your cursor is. You can also type a variable by hand. Bar titles, subtitles and labels, badges, highlights, gift and upsell texts, the savings summary, the sticky bar, subscription texts and the pop-up subtitles all take them.
Every variable
| Variable | In the menu as | Prints |
|---|---|---|
{{saved_percentage}} | Saved percentage | The saving as a percentage, rounded to a whole number |
{{saved_total}} | Saved $ total | What the whole bar saves: the price before the discount minus the price after |
{{saved_amount}} | Saved $ per item | What one item saves |
{{product}} | Product title | The product's title, or the titles of the products in the set |
{{variant_title}} | Variant title | The chosen variant, such as Red / M, or 2× Red, 1× Blue for mixed variants |
{{new_total}} | New total price | The bar's total after the discount |
{{new_price}} | New price per item | One item's price after the discount |
{{new_price / 30}} | New price per day | One item's price after the discount, divided by 30 |
{{original_total}} | Original total price | The bar's total before the discount |
{{original_price}} | Original price per item | One item's price before the discount |
{{new_unit_price}} | New unit price | The price per unit of measure after the discount |
{{saved_per_unit}} | Saved $ per unit | The saving per unit of measure |
{{original_unit_price}} | Original unit price | The price per unit of measure before the discount |
{{unit_quantity}} | Unit quantity | The unit of measure the unit prices count in |
{{quantity}} | Quantity | The number of items in the bar |
{{buy_quantity}} | Buy quantity | The items bought in a Buy X, get Y bar |
{{get_quantity}} | Get quantity | The free or discounted items in a Buy X, get Y bar |
{{gifts_count}} | Number of free gifts | The number of free gifts on the bar |
{{selling_plan}} | Selling plan name | The subscription plan's name |
{{selling_plan_discount}} | Selling plan discount | The subscription plan's discount, as a percentage or an amount |
{{timer}} | Remaining time | The countdown, in the timer's title only |
{{stock}} | Items left in stock | The stock left, in the low stock message only |
Where some variables work
- Variant title is offered in the titles, subtitles and labels of quantity break and Buy X, get Y bars, in highlights and in the sold-out label.
- Buy quantity and Get quantity have a value only on Buy X, get Y bars.
- Unit prices have a value only when the variant has a unit price measure set in Shopify, and they keep their decimals.
- Remaining time works only in the countdown timer's title, and Items left in stock only in the low stock message. Those two fields offer nothing else.
- The discount name at checkout keeps
{{quantity}},{{buy_quantity}}and{{get_quantity}}, filled in, and drops every other variable. See How the discount is applied at checkout.
Simple sums
A variable can take one operation with a number: add, subtract, multiply or divide. New price per day is the built-in example, {{new_price / 30}}. You can write your own, such as {{new_price / 7}} for a price per week or {{quantity + 1}}.
With a price, adding and subtracting count in whole units of the currency, so {{new_total - 5}} takes 5 dollars off in a store that sells in dollars. Dividing keeps decimals. Dividing by zero prints nothing.
Prices, translations, and mistakes
Prices print in the shopper's currency with your store's money format, and Show prices without decimals in the deal's Pricing settings applies to them too. Numbers round to two decimals.
When you translate a deal, write the variables in the translation exactly as in the original. The Translations page warns when they do not match but saves anyway. See Translations, currencies and markets.
A misspelt variable, or one with no value on that bar, prints nothing rather than the braces. If a word disappears from a bar on your store, check the spelling of the variable in its place first.
Adding a variable, in three steps.
Open the text
In the deal editor, open the bar, gift, upsell or setting whose text should change.
Insert the variable
Put the cursor where the value goes, choose Insert variable and pick it from the menu.
Check it in the preview
The preview fills in real values for the bar you select. Select each bar once, since every bar has its own numbers.
If this does not work
The failures most likely on this procedure, with the check that resolves each one.
Theme compatibility and placement
Where the widget places itself, the app block for a custom position, which themes the widget knows and which are verified, page builders, quick view, cart drawers, other bundle apps, and what to redo when you switch themes.
TreStack Checkout docs
Setting up blocks for checkout, thank you and order status pages, upsells, gifts, surveys, the post-purchase page, rules, branding, translations, analytics and billing for TreStack Checkout.