Recommended WordPress Theme

How to Change Sale Badge Text in WooCommerce

5 days ago by Tamas

When you have a discount price set for one of your WooCommerce products, a small sale badge or circle appears on the product’s featured image. Unfortunately, the text on the badge cannot be changed easily, but here is a way.

Open up the functions.php file of you theme and add the following filter:

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

This will change your text.

 

SHARE:

Subscribe to our newsletter!

Get the latest tutorials and articles right into your inbox!


0 comment

LEAVE A REPLY

Your email address will not be published. Required fields are marked *