How to Change the Sale Text in WooCommerce


When you put a product on ‘sale’ in WooCommerce, it will automatically display a ‘Sale’ sticker over the top, which is a great way to alert your customers to the fact that it’s being discounted. However, ‘sale’ isn’t always the right term, especially if it’s a pre-event sale or some other promotion running at the start of a product’s cycle. Luckily there’s a quick fix, though you’ll need to be using a child theme¬†or bespoke theme to apply the change. Assuming this is the case, you just need to add the following code to your functions.php file:


add_filter( 'woocommerce_sale_flash', 'wc_custom_replace_sale_text' );
function wc_custom_replace_sale_text( $html ) {
return str_replace( __( 'Sale!', 'woocommerce' ), __( 'New Sale Text Here', 'woocommerce' ), $html );
}

Just replace the ‘New Sale Text Here’ text with your new ‘sale’ text, and then upload the file to your server – it will automatically apply the change throughout your website.