Skip to content
Nileva B2B Wholesale Pricing is Built for Shopify. Free plan available. See all apps
Nileva
Badges & labels

Shopify Sale Badge: Show the Real Discount Percentage

Product card with a sale badge reading minus 25 percent above a struck-through price

A Shopify sale badge that reads "-25%" instead of a plain "Sale" tells a shopper the size of the saving, as long as the number is right. This guide covers the formula, rounding, variants, fixes for a missing, mislabeled or unwanted badge, and when the "was" price is genuine, then a way to show the percentage without editing theme code.

Key takeaways

  • The percentage is (compare-at price − price) ÷ compare-at price, worked on the exact prices with their cents.
  • Rounding to the nearest whole percent can show up to half a point more than the exact saving; rounding down never shows more.
  • Product cards read the lowest price and the lowest compare-at price of all variants, while a badge that follows the selected variant can show another number for the same product.
  • When a sale badge is missing, start with the prices: the compare-at price must be higher than the price and not $0.00, and in Dawn a sold-out product shows Sold out instead.
  • The former price must be a real one: in the EU the reference is the lowest price of at least the last 30 days.

How Shopify decides a product is on sale

Shopify has no separate "sale" switch. You put a product on sale by entering its original price in the Compare-at price field, which Shopify Help says must be higher than the Price (Shopify Help Center: sale pricing). The same page says your theme "might add a badge with a message or percentage off" to product listing and collection pages, and that the compare-at price is not shown at checkout: only the sale price is.

The default Shopify sale badge belongs to the theme; our guide to Shopify product badges covers the other types. Shopify's theme settings page says Sale and Sold out badges are added to product images automatically when you reduce the price, and that you set their position, shape and color in the theme settings (Shopify Help Center: theme settings).

What the badge says is up to the theme. Shopify's Dawn theme code (the main branch on GitHub, read on 2026-11-18) shows the Sale badge on a product card only when the product's compare-at price is greater than its price and the product is available; a sold-out product gets the Sold out badge instead, because that check comes first. Dawn's card badge prints the word "Sale" from the theme's language file and computes no percentage at all. To show "-20%" on a Dawn card, you need your own theme code or an app.

The sale badge percentage formula, worked

Subtract the price from the compare-at price, divide by the compare-at price, multiply by 100. Example: a tote with a $48.00 compare-at price sells for $36.00. The saving is $12.00; 12 ÷ 48 × 100 = 25, so the badge should read "-25%".

Prices such as $26.99 are less tidy: the exact saving usually lands between two whole numbers. The badge shows whole numbers, so it rounds.

Compare-atPriceExact savingRounded to nearestRounded down
$40.00$26.9932.53%33%32%
$59.99$39.9933.34%33%33%
$25.00$18.7525.00%25%25%
$19.99$13.9930.02%30%30%
Worked example: compare-at 40 dollars, price 26.99, saving 32.53 percent shown as 33
Example prices. Rounding to the nearest percent can add up to half a point

Rounding: nearest or down?

Nileva Product Labels & Badges rounds its Sale badge to the nearest whole percent, the same way in the Product Badges block, on the product page's main image and on product cards. In the first row the exact saving is 32.525% and the badge says 33%: it claims 0.475 of a point, almost half a point, more than the shopper saves.

Rounding down never overstates, but it can understate by almost a full point. If you write your own theme code and want the badge never to promise more than the real saving, round down. If you use the app, check products whose exact saving sits just above a half, such as 32.5% to 32.99%.

Compute on the prices the shopper sees, cents included: rounding $26.99 to $27 first gives 32.5%, not 32.53%. Shopify Markets can customize currency, pricing and theme content for each market (Shopify Help Center: Markets), so check the badge in each currency.

Variants: one product, several percentages

A product with variants can have a different price and compare-at price on each variant. Example: one t-shirt sold in three sizes.

VariantCompare-atPriceSaving
S$30.00$24.0020%
M$30.00$21.0030%
L$30.00$30.000% (not on sale)

A product card has no selected variant, so its number depends on which price it reads. Shopify's Liquid reference defines product.price as "the lowest price of any variants of the product" and product.compare_at_price as "the lowest compare at price of any variants of the product" (Shopify Liquid: the product object). A card that compares those two values works with $30.00 and $21.00 here and shows 30%, the best saving of the three, even though size L is not reduced at all.

The honest wording for a range is "up to 30%". If your badge text is fixed rather than computed, write it that way.

Three variants of a t-shirt saving 20, 30 and 0 percent
Example. Each variant can carry a different percentage

The lowest values can also come from different variants and cancel each other out. Example: a mug in two colors, white at $30.00 with its compare-at price also set to $30.00, and blue at $35.00 with a compare-at price of $40.00. The lowest price is $30.00 and the lowest compare-at price is $30.00, so a card that compares the two finds no sale, although blue is 12.5% off ((40 − 35) ÷ 40).

Product cards vs the product page

In Product Labels & Badges, where the badge sits decides which prices it reads. The inline Product Badges app block reads the selected variant, or the first available one, when the page is rendered. The badge over the product page's main image reads the product-level price and compare-at price from Liquid, the lowest values described above, and so does the badge on product cards. With both turned on, the block and the main image can show two different percentages for the same product.

Open a product with several reduced variants, compare the main-image badge with the Product Badges block, then pick another size. We have not confirmed that the block's percentage updates without a page reload, so test it on your theme before a sale.

Cards appear on collection pages, search results, the home page and related products. Our guide to badges on collection pages and product cards covers how they behave there.

Shopify sale badge not showing, wrong text or color: the fixes

Each problem has two answers, because the theme's own Shopify sale badge and an app's badge are separate: changing one leaves the other as it is.

Sale badge not showing

For the theme's own badge, start with the prices. The compare-at price must be higher than the price, and Shopify Help warns that a compare-at price of $0.00 isn't the same as an empty field. In Dawn, a product that is sold out shows Sold out instead of Sale. On cards, the mug case above applies.

For the app's Sale badge, check four things in order:

  1. For badges over images and cards, the Nileva Product Badges app embed (Product Badges & Labels) is on in Online Store → Themes → Edit theme → App embeds (the icon in the sidebar), and saved. The Product Badges block works without it.
  2. The badge is Active, not Draft: check the Active switch above the badge's preview.
  3. In Auto mode, the product has a compare-at price higher than its price.
  4. If Also apply a real % discount at checkout is on, the badge shows the percentage Shopify accepted at your last save. If Shopify refused to create the discount, the badge shows no percentage and appears only on products with a compare-at price, until you save it again.

The app embed keeps badges off the cart page on every theme and skips cart drawers built like Dawn's; drawers on other themes are untested, so open yours to check. Badges never show at checkout.

Change the sale badge text

Dawn's word "Sale" comes from the theme's language file. Shopify's page on changing the wording in themes gives the route: in your Shopify admin go to Online Store, open the menu beside the theme, choose Edit default theme content, find the phrase with the Filter items search bar, edit the text and click Save. That text is the same on every product, so it cannot hold a computed percentage.

In the app, set Discount source to Manual text and type your own words in Discount text. Manual text is also the only way to show a dollar amount, because Auto always shows a percentage.

Manual text is the same on every product the badge shows on. Unless the badge has a real discount (described below), on the Free plan that means every product whose compare-at price is higher than its price, so a fixed "Save $10" or "-20%" is only true if every reduced product saves that much; limiting the badge to chosen products or collections is part of Pro. With the real discount on and a percentage Shopify accepted at your last save, the badge shows on every product it targets, with or without a compare-at price.

Change the sale badge color

In Dawn's code, the Badges settings group holds a color scheme setting for the Sale badge, next to the badge position and corner radius. Other themes may name it differently.

The app's badge has its own Background color and Text color in the badge's style settings. Its default Sale colors are white text on red (#EF4444), and you can change both.

Remove the sale badge

Dawn's Badges settings have no switch that turns the Sale badge off. To stop it on a product, end the sale: Shopify Help tells you to clear the compare-at field entirely for variants that shouldn't display a compare-at price. Hiding it while the product stays reduced takes a theme code edit.

To remove the app's badge, switch off Active or delete the badge. If it also created a real discount, the app removes that discount when the badge is turned off or deleted.

The app does not hide or change your theme's own Sale badge, so a reduced product can show the theme's "Sale" and the app's "-25%" side by side. Decide which one you want before the sale starts.

Show the percentage on Shopify without code

If you want a sale badge app for Shopify that computes the percentage for you, Nileva Product Labels & Badges does it. Its Sale badge on all products is part of the Free plan; targeting chosen products, collections or tags is part of Pro. To set it up:

  1. In the app, open Badges and click Create badge.
  2. Set Badge type to Sale.
  3. On the Design tab, under Sale settings, set Discount source to Auto from compare-at price.
  4. Save. The Active switch above the preview is already on for a new badge, so the badge goes live as soon as you save; switch it off first if you want to save a draft.
  5. Turn on the Nileva Product Badges app embed (Product Badges & Labels) in Online Store → Themes → Edit theme → App embeds (the icon in the sidebar), and save.

The badge then shows on product cards and over the product page's main image. To show it inline next to the product information as well, add the Product Badges app block to the product page in the theme editor with Add block.

Sale settings with Discount source set to Auto from compare-at price
No code: the badge computes the percentage itself

There is a second mode for products that have no compare-at price. Switch on Also apply a real % discount at checkout: the Discount percentage field appears already set to 20, and that number is saved with the badge, so change it to the whole number from 1 to 100 that you want. The app creates and manages a Shopify automatic percentage discount for the badge's products, and the badge shows the percentage Shopify accepted at your last save, with no compare-at price needed. This works with All products, Collections or Specific products targeting, and the discount is updated on every save. With any other targeting the editor refuses to save the badge while the switch is on, with a message that asks you to change Targeting or turn the switch off. The discount is built from the badge's targeting only and ignores Exclude products: a product you exclude gets no badge, but it still gets the price cut at checkout.

Shopify applies the price cut automatically in the cart and at checkout (Shopify Help Center: automatic discounts).

Because a new badge is already Active, the first Save with this switch on creates the discount for every product the badge targets, live at once, unless Active dates has a start date and time still ahead (Pro): then Shopify holds the discount until then, and the badge follows the same start in the shopper's browser. If Active dates has an end, the discount ends then, and the badge follows the same end. Check Discount percentage before you save.

In that mode, with Discount source on Auto from compare-at price, the badge shows the percentage Shopify accepted at your last save, and nothing else; with Manual text it shows your text. It never adds a compare-at saving on top, so check products that have both.

The app does not check the discount in Shopify again after you save, so a discount you delete by hand in the Shopify admin is noticed only the next time you save the badge. If Shopify refuses to create the discount when you save, the badge is still saved and an error message says so, but no percentage shows (the badge falls back to the compare-at rule and appears only on products with a compare-at price) until you save the badge again. If Shopify refuses only a change to a discount that already exists and you did not change the targeting, the badge keeps showing the percentage Shopify still applies.

Is your "was" price genuine?

A percentage is only as honest as the price it starts from. Product Labels & Badges reads the compare-at price you entered; it keeps no price history and does not check how long the product sold at that price. Several rules describe what that price must be.

  • United States. The FTC's guide on former price comparisons says a former price is a legitimate basis when it is "the actual, bona fide price at which the article was offered to the public on a regular basis for a reasonably substantial period of time"; an inflated price set up to allow a large reduction makes the bargain a false one (16 CFR 233.1).
  • European Union. Under the rule that EU member states apply from 28 May 2022, an announced price reduction must indicate the prior price, defined as the lowest price the trader applied in a period of not less than 30 days before the reduction (Directive (EU) 2019/2161, Article 2). Shopify Help explains the rule and states that the merchant is responsible for applying it (Shopify Help Center: Price Indication Directive).
  • United Kingdom. The CMA wrote that price reduction claims are misleading where they no longer reflect the item's usual price (CMA blog on urgency and price reduction claims (2023)).

Google Shopping ads apply their own test before they show a sale price annotation, including a discount between 5% and 90% and a minimum number of days at the base price (Google Merchant Center Help).

This section explains what these rules say. It is not legal advice; check with a lawyer for your market.

If you are preparing a seasonal sale, our guide to Black Friday badges on Shopify covers scheduling badges for the sale dates and taking them down afterwards.

Frequently asked questions

How do I show the discount percentage on a Shopify sale badge?

Edit the theme's card and price code to compute (compare-at − price) ÷ compare-at, or use an app that computes it, such as Product Labels & Badges with Discount source set to Auto from compare-at price.

Why is my Shopify sale badge not showing?

Check that the compare-at price is higher than the price and is not $0.00, and that the product is not sold out (Dawn shows Sold out first). For an app badge, also check that it is Active and, for badges over images and cards, that the app embed is on, and, with the real discount on, that Shopify accepted it.

Why does my sale badge show 33% when the discount is 32.5%?

Product Labels & Badges rounds to the nearest whole percent, so 32.53% becomes 33%; theme code may round another way.

Why is the percentage different on the collection page?

A card has no selected variant, so it reads the lowest price and lowest compare-at price of any variant. A badge that follows the selected variant, such as the app's Product Badges block, can show a different number.

Can I show "Save $10" instead of a percentage?

Yes: in the app, choose Manual text and type "Save $10" in Discount text, or change your theme's code. Auto always shows a percentage.

Does the percentage have to be measured from a 30-day low price?

In the EU, an announced reduction must refer to the lowest price applied in at least the 30 days before it; other markets have their own rules. This is not legal advice; check with a lawyer for your market.

Try it

Turn on a Sale badge that computes the percentage from your compare-at prices.

More to read

Style
Font