This website uses cookies

Our website, platform and/or any sub domains use cookies to understand how you use our services, and to improve both your experience and our marketing relevance.

Exclusive Webinar with Adobe officials: Best Practices, Upgrades, and Community Impact! Join Now →

How to Add Custom Sales Badge Text in WooCommerce

Updated on November 23, 2022

2 Min Read
woocommerce sales badge

A sales badge is a small banner displayed on a product page or in a product listing, and it is typically used to highlight a sale or promotion.

By default, WooCommerce includes a basic sales badge that displays the percentage discount for a product, but store owners can also customize the text and appearance of the badge to suit their needs better.

In this tutorial, I’ll show you how to add custom sales badge text in WooCommerce, so that you can effectively promote your sales and drive more conversions.

Benefits of Custom Sales Badge Text

Here are a few benefits of adding custom sales badge text in WooCommerce:

  • Attract attention: By customizing the text and appearance of the badge, store owners can make it stand out and effectively communicate the promotion details.
  • Increase conversions: By highlighting the savings or benefits of a promotion, a sales badge can help to drive more conversions and increase sales.
  • Improve user experience: Custom sales badge text can help improve customers’ experience by providing them with clear and accurate information about promotions and sales.
  • Flexibility: By using custom sales badge text, store owners have the flexibility to tailor the language and appearance of the badge to match the tone and branding of their store.

From launching to customizing your WooCommerce stores, Cloudways is at your service.

Whether you’re a beginner or an expert, Cloudways Platform is based on UI, where you can create and customize your online store in a few seconds.

Default Sales Badge Text in WooCommerce

Some WooCommerce store owners don’t like the default sale badge text and want to customize it, e.g., 50% off. By default, it looks like this:

before sale badge

Add Custom Sales Badge in WooCommerce

To customize sales badge text in WooCommerce, you just need to add the following code to the functions.php file of your theme.

add_filter('woocommerce_sale_flash', 'woocommerce_custom_sale_text', 10, 3);
function woocommerce_custom_sale_text($text, $post, $_product)
{
return '<span class="onsale">50% Off</span>';
}

After adding the code, your sales badge text will look like this:

After sale badge

Summary

The sale badge text is the most eye-catching portion of the product viewer. You can also include event names such as Black Friday, Christmas, and others to attract buyers and mention your deals and discount offers. This can help attract customers’ attention, increase conversions, and improve the user experience.

Share your opinion in the comment section. COMMENT NOW

Share This Article

Customer Review at

“Great performance for the price, and plenty of control”

Sean P [SMB Owner]

Owais Alam

is the WordPress Community Manager at Cloudways - A Managed WooCommerce Hosting Platform and a seasoned PHP developer. He loves to develop all sorts of websites on WordPress and is in love with WooCommerce in particular. You can email him at [email protected]

×

Get Our Newsletter
Be the first to get the latest updates and tutorials.

Thankyou for Subscribing Us!

×

Webinar: How to Get 100% Scores on Core Web Vitals

Join Joe Williams & Aleksandar Savkovic on 29th of March, 2021.

Do you like what you read?

Get the Latest Updates

Share Your Feedback

Please insert Content

Thank you for your feedback!

Do you like what you read?

Get the Latest Updates

Share Your Feedback

Please insert Content

Thank you for your feedback!

Unleash The Cloud.
Not Budgets.

For 4 Months +
Up To 30 Free Migrations

Cyber Week

SAVINGS
Time Left In Offer
  • 0

    Days

  • 0

    Hours

  • 0

    Minutes

  • 0

    Seconds

40% OFF

On All Plans

GET THE DEAL NOW