Magento 2 Product Badges & Labels

Magento 2 product badges, labels and stickers for Luma and Hyvä: sale, new, low-stock and custom labels set by rules with smart conditions, indexed for fast category listings.

  • Magento 2.4.6 – 2.4.9
  • PHP 8.2 – 8.5
  • Hyvä and Luma
  • Version 2.0.4
$149

One-off payment, with 12 months of updates.

What is included

  • Install with Composer, or download a zip from your account
  • Licence for one production domain, staging and development copies included

No subscription or automatic renewal. Keep using the versions included in your update period. Update and licence details

Key features

  • Smart conditions: on sale, new, low stock, out of stock, best seller, free shipping
  • Attribute, category, price range and product type conditions
  • Text or image labels in five shapes
See all features

Composer package commercegears/module-product-labels

Product labels in Magento 2 are small, but they do a lot of selling: "-20%", "New", "Only 3 left". Magento has no rule-based labels of its own, so most stores end up editing images or templates by hand. This extension adds custom product labels and badges by rule, on category pages, search results, widgets and the product page, for Luma and Hyvä.

How the labels are chosen

A label is a rule. It can follow smart conditions such as on sale (with a minimum discount), new, low stock, out of stock or best seller, or plain conditions on attributes, categories, price ranges and product types. Text labels can use variables like {discount_percent} or {qty}, so one "Save {discount_percent}%" label works for the whole catalogue.

How they look

Use text or an image, in a rectangle, pill, circle, ribbon, tag or corner ribbon, with your own colours. Place the label in one of nine positions on the image, under the name or after the price, with a different look on the product page and in listings. The admin form shows a live preview.

Labels are assigned by an indexer and refreshed by cron, so they add no work to page loads.

  • The right badge on the right product

    Rules pick the products: on sale, new, low in stock, best sellers or any attribute condition. No product needs to be edited by hand.

  • Indexed, not evaluated per page

    An indexer stores which product gets which label, so category pages read the result instead of checking rules while they render.

  • Keeps itself up to date

    An hourly cron re-checks labels that depend on time, stock or sales, and cleans the page cache when a dated label starts or ends.

All features

What is included

Conditions

  • On sale, with an optional minimum discount
  • New ("Set Product as New" dates or created within N days)
  • Low stock and out of stock
  • Best seller: top N by ordered quantity in the last X days
  • Free shipping attribute, price range, product types and attribute conditions

Appearance

  • Text or image (JPG, PNG, GIF, WebP)
  • Rectangle, pill, circle, ribbon, tag or a corner ribbon that wraps round the image corner (from version 1.3.0)
  • Background colour, text colour, size and CSS class
  • Nine positions on the image, under the name or after the price
  • Variables: {discount_percent}, {discount_amount}, {qty}, {new_days}, {attribute:code}

Where labels appear

  • Category pages and search results
  • Catalogue widgets, recently viewed and compared
  • Related products, up-sells and cross-sells
  • Product page: main image, name and price
  • Luma and Hyvä, desktop and mobile

Control and performance

  • Store views, customer groups and From/To dates
  • Priority, "Stop Further Labels" and a maximum per product
  • Two indexers, Update on Save or Update by Schedule
  • Hourly refresh and nightly rebuild by cron
  • CLI to apply labels and check a product

Feature tour

Everything your shoppers and your team see

01 / 07

Discount badges that show the real discount

"-{discount_percent}%" becomes -20% on each product, worked out from the special price or catalogue price rule the visitor actually gets.

02 / 07

Native Hyvä support

Labels on Hyvä category pages and widgets, with the label CSS added to your theme's Tailwind build. Here: "New" ribbons and an "Only 2 left" tag under the product name.

03 / 07

A separate label for the product page

Each label has its own text, shape, colours, size and position for the product page, for example a larger "Sale -20%" on the main gallery image.

04 / 07

Works on small screens

Labels stay on the product image on phones, on Luma (left) and Hyvä (right).

05 / 07

All labels in one grid

Preview, status, priority, store views, dates and the number of matching products per label, with mass enable, disable and delete and "Apply All Labels Now".

06 / 07

Smart conditions without custom attributes

Switch on On Sale (with a minimum discount), New, Low Stock, Out of Stock, Best Seller or Free Shipping, and combine them with a price range, product types and attribute conditions.

07 / 07

See the label while you design it

Text or image, shape, colours, size and position, with a live preview for the product page and for listings.

Live demo

Try it before you install it

A full Magento store with the module installed, on Luma and on Hyvä. The admin demo signs you in with one click.

Compatibility

Requirements and compatibility

Compatibility of Product Labels
Magento2.4.6 – 2.4.9
PlatformsMagento Open Source and Adobe Commerce (one price)
Storefront themes Luma Blank Hyvä
PHP8.2 – 8.5
Latest version 2.0.4
composer.json requires php ~8.2.0||~8.3.0||~8.4.0||~8.5.0 magento/framework ~103.0.6 commercegears/module-core ^2.0 free, installed by Composer with this module magento/module-backend * magento/module-catalog * magento/module-catalog-inventory * magento/module-catalog-rule * magento/module-config * magento/module-customer * magento/module-indexer * magento/module-rule * magento/module-sales * magento/module-store * magento/module-ui *

Installation

Up and running in minutes

After you buy, create a Composer key in your account. Then, in the root of your Magento project:

  1. 01Add the repository and your key (once per project)

    composer config repositories.commercegears composer https://repo.commercegears.com
    composer config --auth http-basic.repo.commercegears.com PUBLIC_KEY PRIVATE_KEY
  2. 02Install the module

    composer require commercegears/module-product-labels
  3. 03Enable it

    bin/magento setup:upgrade
    bin/magento setup:di:compile
    bin/magento setup:static-content:deploy
    bin/magento cache:flush

    The last three are only needed in production mode.

Prefer a zip? Every version you are entitled to can be downloaded from My modules. More about Composer access

User guide

Setting up Magento 2 Product Badges & Labels

The user guide has its own page: how to install Magento 2 Product Badges & Labels, what each option does and how to use it in your store. Written for version 2.0.4; a copy ships with the module.

In the guide

Read the user guide

Changelog

Release notes

2.0.4

Latest
  • Fix: the labels on the product image no longer breaks on stores with HTML minification switched on.

2.0.3

  • Fix: discount percentages round exactly like CommerceGears Product Compliance, so labels and badges agree.

2.0.2

  • Improvement: compatible with Magento 2.4.6 (PHP 8.2).

2.0.1

  • Improvement: user guide screenshots and links updated for the CommerceGears name

2.0.0

  • Improvement: renamed to CommerceGears (new Composer package, admin menu and settings paths)

FAQ

Questions, answered

Something else on your mind? The developers who wrote the module answer before and after you buy.

Ask a question →

Already installed it? Open a support ticket

Which conditions can a label use?

Smart conditions (On Sale with an optional minimum discount, New, Low Stock, Out of Stock, Best Seller and Free Shipping), a price range, product types, and attribute conditions built with the same condition builder as catalogue price rules (attributes, attribute set, category, SKU and so on). A product gets the label when it matches every condition you switched on.

Does it work with Hyvä?

Yes. The module has Hyvä layout handles and registers itself for Hyvä's Tailwind build, so the label styles are added to your theme CSS. After installing, rebuild the theme CSS once. Luma and themes based on it load a small CSS file instead.

Where are labels shown?

On category pages, search results, catalogue widgets, related products, up-sells, cross-sells and the recently viewed and compared widgets, and on the product page (main gallery image, under the product name or after the price). Labels are not added to cart, mini cart, wishlist or compare thumbnails.

Will it slow down my category pages?

Labels are assigned by an indexer, so category pages read the stored result with one query per product list instead of evaluating rules for every product. Only rows that changed are written, and only the page cache of products whose labels changed is cleaned.

Can the label show the actual discount?

Yes. Use {discount_percent} or {discount_amount} in the label text. The discount comes from the special price or catalogue price rule and is worked out when the page is rendered, so it matches the price the visitor sees. The percentage is rounded to whole per cent (29.5% shows 30). With CommerceGears Product Compliance (Omnibus) and its setting "Struck-through Price Is the Prior Price", the discount is worked out from the prior price, so the label and the module's percentage show the same number. Other variables are {qty} (quantity in stock), {new_days} (days since the product became new) and {attribute:code} (any product attribute; option labels are resolved).

A configurable product on a Luma category page shows "-20%" but no old price. Is that right?

Yes. For configurable products the label uses the lowest final price of the options against their lowest regular price, as the "As low as" price does. Luma (Magento core) hides the old price of configurable products on listings and shows it on the product page once an option is chosen; Hyvä shows it on listings too.

Can I use my own image instead of text?

Yes. Set Label Type to Image and upload a JPG, PNG, GIF or WebP file of up to 2 MB. The label text is then used as alternative text. A transparent PNG or WebP works best.

What if a product matches several labels?

Labels are shown in priority order (lower numbers first). Stop Further Labels on a label hides labels with a higher priority number on the products that have it, and Maximum Labels per Product in the configuration limits the number of labels per product.

Can I show a label only to some customers or for a limited time?

Yes. Each label has store views, customer groups and From/To dates. They are checked when the page is rendered. When a dated label starts or ends, the hourly cron cleans the page cache of its products, so cached pages follow within the hour.

How does Best Seller work?

It takes the top N products by ordered quantity in the last X days. Order states listed under Best Seller: Ignore Order States (default canceled,closed) are not counted. Sales are counted over all store views.

Does it support Multi-Source Inventory?

The stock conditions and {qty} read the CatalogInventory stock tables. Setups with Multi-Source Inventory have not been tested.

My theme uses its own product list images. Will labels appear there?

Listing labels are added to images built through Magento's product image factory with known image IDs. If your theme or a slider uses its own image IDs, add them under General > Additional Listing Image IDs (comma-separated, from the theme's etc/view.xml).

How do I check why a product has (or does not have) a label?

Run bin/magento commercegears:product-labels:check <sku>. It lists the labels indexed for the product per store view, with priority and status. Remember that customer groups, dates and the real discount are checked later, when the page is rendered.

Support

Help from the developers who wrote it

From the blog

Guides and articles