Docs

Sale Badge

A sale or discount badge shown only while the product is on sale, and optionally "Sold out" when it is out of stock.

On this page

The Sale Badge widget shows a small badge while a WooCommerce product is on sale: a text such as "Sale!", the discount such as "-20%", or both. It can also say "Sold out" when the product is out of stock. At other times it shows nothing, so it can sit over the product image of a product card without leaving an empty box.

Three product cards with a badge over the corner of the image: −21%, Sale! and Sold out, with the product name and price below each image
Sale Badges placed over the product image: the discount, the text, and “Sold out” for a product out of stock.

Where the product comes from

The widget shows the product being viewed: on a product page template it is the product the visitor opened, and in a product loop item it is each card's product. To show one particular product anywhere else, pick it in the Product section of the Content tab.

The discount is worked out from the regular and sale price. For a product with options, it is the largest discount among its options; for a grouped product, the largest among the products in the group on sale. When there is no discount to show, the badge shows its Text instead.

When "Sold out" when out of stock is on, an out-of-stock product shows "Sold out", even while it is on sale.

In the editor, the badge also shows on products that are not on sale, faded, so you can style it. Hover it to see Shown only while the product is on sale.

Add a Sale Badge

Open your product page template or a product loop item in the Theme Builder. Then click Insert in the rail on the left, find Sale Badge in the WooCommerce group (or type "sale" in the search box) and drag it into the template. See Add elements.

Place it over the image

In a product card, put the image and the badge in the same container. Select the badge, open Design → Spacing & position, set Position to Absolute and move it into a corner with the offsets. See Spacing, size & position.

Content tab settings

Content tab · Badge
SettingWhat it does
ShowsText, Discount (-20%) or Text and discount. Default: Text.
TextThe badge text. Default: Sale!. Not shown for Discount (-20%).
"Sold out" when out of stockShows a badge on out-of-stock products too. Off by default.
Sold out textDefault: Sold out. Shown when "Sold out" when out of stock is on.
AlignmentLeft, Center or Right. Can differ per device.
Content tab · Product
SettingWhat it does
ProductLeave empty to show the product being viewed (product pages, product loop items). Pick a product to show it on any page.

Design tab settings

Design tab
SectionSettings
BadgeTypography, Text color, Background, Sold out text color and Sold out background (when sold out is on), Padding, Border radius and Border.

Until you change them here, the colors come from Design System → Shop → Sale badge. See Shop styles. The Design tab also has the sections every element shares: Spacing & position, Background & border and Mask.

Behaviour tab

The Behaviour tab has the settings every element shares: anchor and classes, entrance animations, motion effects, visibility per device, display conditions and interactions. See Visibility.

Tips

  • On a product page, the Product Images widget can show a simple sale badge on the image itself.
  • For the discount inside other text, such as a heading "Save 20% this week", use the Product discount dynamic tag. See Dynamic tags.