Articles on: Regios Discounts

Discount Description Templates

TO READ THE DOCS FOR THE "DISCOUNTED PRICE" APP BLOCK, CLICK HERE.



Click the thumbnail above to watch our founder explain how to set up discount description templates.


Screenshot of the default discount description template


You can customize the text our app displays beneath discounted prices. For example, you might want to let users know that they received a special discount for being a loyal customer.


IMPORTANT

  • Please note that Discount Description Templates only apply to messages shown by our "discount on product page" (DOPP) feature. For example, discounts on product pages, collection pages, related/complementary products sections, and the search page can be customized with this feature.
  • Discount Description Templates cannot be used to customize the cart. The display of discounts in the cart is controlled by your theme's Liquid, not our app.


The discount description is HTML, so you can add tags and styles to your liking.


You can also use variables, which are based on the discount calculations we did for each product. They will be automatically replaced with the corresponding text/number when the discount description is displayed on the page.


Available variables


Text variables

  • [discount_message]: The title of the applied discount, as it would appear in the customer's cart/checkout.
  • [time_left]: A live countdown to when the applied discount ends, for example 2d 4h 13m, 4h 13m, or 13m 05s in the last hour. It's empty for discounts without an end date, and the description hides when the discount ends. This variable is part of the Storefront Widgets add-on, which you can turn on from the Billing page in the app.


Number variables

  • [regular_price]: The price of the product before any discounts were applied. By default, it will be formatted into the local currency.
  • [sale_price]: The price of the product after discounts were applied. By default, it will be formatted into the local currency.
  • [unit_price]: The price per unit of the product after discounts were applied. By default, it will be formatted into the local currency.
  • [discount_amount]: The difference between the [regular_price] and the [sale_price]. By default, it will be formatted into the local currency. Example: $5.00 (or $5.00 USD if you have the Currency code enabled? option on).
  • [discount_percentage]: The difference between the [regular_price] and the [sale_price]. This number will be rounded automatically. By default, it will be formatted as a percentage. Example: 20%.


Filters

To gain more control over the display of the discount description, you can use filters, which work like Liquid filters, to transform variables, or control their formatting. You can also chain filters.


Filters only work with number variables.


Examples:

  • [sale_price | to_fixed:2]
  • [discount_amount | fractional_part | to_fixed:2]


Available filters:


Math filters

  • integer_part: The whole part of the number (removes any decimals). Example: Turns $12.34 to 12
  • fractional_part: The fractional part of the number, without the decimal point ( .). Example: Turns $12.34 to 34
  • ceil: Applies a mathematical ceiling operation to the number. Example: Turns 12.34 to 13.
  • floor: Applies a mathematical floor operation to the number. Example: Turns 12.34 to 12.
  • round: Applies a mathematical round operation to the number. Example: Turns 12.34 to 12, and 12.55 to 13.
  • times:N: Multiplies the number by another number. Example: If sale_priceis 10, then sale_price | times:2 yields 20.
  • divided_by:N: Divides the number by another number. Example: If sale_priceis 10, then sale_price | divided_by:2 yields 5. If N == 0, nothing happens.
  • minus:N: Subtracts another number from this number. Example: If sale_priceis 10, then sale_price | minus:2 yields 8.
  • plus:N: Adds the number to another number. Example: If sale_priceis 10, then sale_price | plus:2 yields 12.


Formatting filters

  • money: Formats the number as a monetary amount (follows the "Currency code enabled?" setting from the Discounts Embed).
  • money_without_trailing_zeros: Formats the number as a monetary amount, like money, but strips trailing zeros, following the same rules as Liquid.
  • percentage: Formats the number as a percentage (by appending a %).
  • to_fixed:N: Formats the number by rounding the number to N places. Example: [sale_price | to_fixed:2] turns 12.3456 to 12.34.
  • zero_pad_start:N: Formats the number by adding leading 0 until the length is at least N characters. Example: zero_pad_start:3 turns 3 into 003
  • zero_pad_end:N: Formats the number by adding trailing 0 until the length is at least N characters. Example: zero_pad_start:3 turns 3 into 300


Examples

  • Savings: [discount_amount | round] (Displays savings as a monetary amount)
  • <b>[discount_percentage] off</b> for wholesale customers (Displays savings as a percentage)
  • [discount_message] ends in [time_left] (Displays a countdown, e.g. "Summer Sale ends in 4h 13m")


Advanced Examples

Screenshot of template with superscript


You save:
<span style="color: green; font-weight: bold">
$[discount_amount | integer_part]
<sup>[discount_amount | fractional_part | round | zero_pad_end:2]</sup>
</span>
!


(Advanced. Displays savings using a superscript for the decimal part)


To turn the countdown off, remove [time_left] (and any words around it, like "ends in") from your discount description template.


The [time_left] countdown is wrapped in <span class="regios-dopp-time-left">, so you can style it on its own with custom CSS, for example:


body .regios-dopp-time-left { color: #c0392b; font-weight: 700; }


Show a discount before the shopper gets it (teasers)


Normally the description only shows once a shopper gets the discount. Two per-discount options show it to shoppers who don't get it yet. The product keeps its original price (no strikethrough), and the teaser text shows under the price instead. Both are part of the Storefront Widgets add-on, which you can turn on from the Billing page in the app.


  • Show the code before it's applied: for a discount code with exactly 1 code, available to all customers. Product pages show "10% off with code FALL10". Once the shopper applies the code, the normal strikethrough shows.
  • Show the members price to other shoppers: for an automatic discount limited to customer tags or signed-in customers. Shoppers who don't qualify see "Members pay $36.00. Sign in", and "Sign in" links to your store's login page. Shoppers who qualify see the normal strikethrough.


To turn one on, open the discount in our app, find the "Display on online store" card, and tick the option. The option only appears on discounts it can work with. Discounts that use customer segments can't use the members price, because Shopify checks segments only at checkout.


To turn a teaser off, open the discount, untick the option in the "Display on online store" card, and save.


A teaser only shows when no other discount applies to that shopper. If several teasers fit, the lowest price wins. Products with a compare-at price don't show a teaser.


Teaser wording


Leave the wording blank to use our default, which is translated for each store language:


  • Code: [discount_percentage] off with code [code]
  • Members price: Members pay [unit_price]. <a href="[sign_in_url]">Sign in</a>


To change it, click "Customize wording" under the option and type your own text. You can use the variables above plus [code] (the discount code) and [sign_in_url] (your login page). Custom wording isn't translated.


The code is wrapped in <span class="regios-dopp-teaser-code">, so you can style it with custom CSS, for example:


body .regios-dopp-teaser-code { font-weight: 700; letter-spacing: 0.05em; }


Have any feedback for us?

We want to hear about your experience with our app! Leave a review on the Shopify App Store.

Updated on: 03/11/2026

Was this article helpful?

Share your feedback

Cancel

Thank you!