Chat with us, powered by LiveChat

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.

How to Change Sale Badge Text in WooCommerce

May 30, 2016

2 Min Read
Reading Time: 2 minutes

WooCommerce adds sale badge to the items that are on sale. In the event that products have a lower cost than the real value, WooCommerce will include sale badge.

woocommerce sale badge text

Some people don’t like the default sale badge text and need to change it to something like 50% off etc. So today, we are demonstrating how to change sale badge text to something you like.

By default, it looks like this:

before

Now add this code to the functions.php file of your theme.

<?php
add_filter('woocommerce_sale_flash', 'woocommerce_custom_sale_text', 10, 3);
function woocommerce_custom_sale_text($text, $post, $_product)
{
    return '<span class="onsale">PUT YOUR TEXT</span>';
}

After adding the code, it will look like this:

place your text

Conclusion

Sale badge text is the most eye catching portion of the product viewer. You can also put event names like Black Friday, Christmas day and many more occasions to attract buyers. Also, you can mention your deals and discount offers.

[Read: 13 Essential Plugins And Extensions For WooCommerce Stores]

Share your opinion in the comment section. COMMENT NOW

Share This Article

Your WooCommerce Store Needs A Reliable Host

With no compromise on Performance, Security & Support.

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 owais.alam@cloudways.com

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

Do you like what you read?

Get the Latest Updates

Share Your Feedback

Please insert Content

Thank you for your feedback!