> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://regiostech.crisp.help/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Discount Description Templates

**TO READ THE DOCS FOR THE "DISCOUNTED PRICE" APP BLOCK, [CLICK HERE](/en/article/discounted-price-block-1okev30/).**

[![](https://storage.crisp.chat/users/helpdesk/website/d13e90de659a8800/image_wyfwbk.png)](https://www.loom.com/share/fe7e9c1e615d400ab3820ef9562a0008)

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

![Screenshot of the default discount description template](https://storage.crisp.chat/users/helpdesk/website/d13e90de659a8800/image_do4krt.png)

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.

### 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_price`is `10`, then `sale_price | times:2` yields `20`.
* `divided_by:N`: Divides the number by another number. Example: If `sale_price`is `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_price`is `10`, then `sale_price | minus:2` yields `8`.
* `plus:N`: Adds the number to another number. Example: If `sale_price`is `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](https://shopify.dev/docs/api/liquid/filters/money_without_trailing_zeros).
* `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)

## Advanced Examples
![Screenshot of template with superscript](https://storage.crisp.chat/users/helpdesk/website/d13e90de659a8800/image_j501u2.png)

```html
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)

## Have any feedback for us?
We want to hear about your experience with our app! [Leave a review on the Shopify App Store](https://apps.shopify.com/regios-automatic-discounts#modal-show=ReviewListingModal).