GET FREE VERSION GET THE PRO VERSION

How to Create a Label Based On Product Quantity

Learn how to create labels/badges based on product quantity data.

In this article

Overview

In this article we will learn how to create WooCommerce product labels and badges based on product quantity data. With such labels you can notify users about the exact value of current product quantity, remind users when a product is almost sold out, or highlight new arrivals.

Examples:

  • Show quantity data inside a product label.

    Label with quantity data inside

    Label with quantity data inside

  • Show label based on current product minimal quantity value.

    Label with 'Almost sold out' text

    Label with 'Almost sold out' text

  • Show label based on current product maximal quantity value.
    Label with 'New Arrivals' text

    Label with 'New Arrivals' text

We can create such a label with the help of plugin built-in tools like text variables and display conditions.

Create a label with quantity number inside

Label with quantity data inside

Label with quantity data inside

Now let’s look at how to create a label that displays the current product quantity value.

  1. Go to the Adv. Woo Label page and click the Add New label button.
  2. Choose the Label Conditions option depending on your needs – for example, set it to
    Stock Status - equal to - In Stock
    to show it for all In Stock products.

    Display conditions for label with quantity value


    Display conditions for label with quantity value

  3. For the Label text option, set the value:
    Only {QTY} left
    Label text option for label with quantity value

    Label text option for label with quantity value

    This will show a label with custom text and the quantity value in place of the {QTY} text variable. You can change that text to any other depending on your needs.

  4. Other badge options are optional. You can set custom styles, animations, links, positions, etc.
  5. When you are ready, click the Publish button to save your changes. Now you can check your label. It will be visible for all products that have the specified quantity value and meet the specified display conditions.

Show a label based on quantity value

Show label based on product quantity value

Show label based on product quantity value

Now let’s see how to create labels and badges that appear depending on product quantity values. For example – they will only be visible for products with quantity value less or equal to 10.

  1. Go to the Adv. Woo Label page and click the Add New label button.
  2. Set a new rule for the Label Conditions option:
    Product quantity - less or equal to - 10

    Display conditions for label that shown based on quantity value

    Display conditions for label that shown based on quantity value

  3. For the Label Text option set any value you want. In our case it will be:
    Almost sold out!
    Label text option for label that shown based on quantity value

    Label text option for label that shown based on quantity value

  4. Other badge options are optional. You can set custom styles, animations, links, positions, etc.
  5. When you are ready, click the Publish button to save your changes. Now you can check your label. It will be visible for all products that have the specified quantity value and meet the specified display conditions.

FAQ

How do I display the exact stock quantity in my label?

Use the {QTY} text variable in your label text. For example, set the Label text to Only {QTY} left, and ensure your display conditions include products with Stock Status equal to In Stock.

Can I customize the appearance of my quantity labels?

Yes. After setting your label conditions and text, you can adjust styles, animations, links, and positions under the badge options. These settings let you match labels to your store’s design.

How can I create multiple labels for different stock levels?

Create separate labels with different display conditions. For instance, one label for products with quantity less or equal to 10 ( Almost sold out ) and another for products with quantity greater than 50 ( New arrivals ). Adjust each label’s text and conditions accordingly.