How to Change the Sale badge text in WooCommerce

This is a small amount of code which allows the WordPress Theme developers to change Sale badge text in WooCommerce.

Quick Tip : Change “Add to cart” button text in WooCommerce

All you have to do is drop the following code snippet in your functions.php file located inside your theme folder.

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

And don’t forget to replace Bestbuy with your own custom text.

Change the Sale badge text in WooCommerce

Change the Sale badge text in WooCommerce

 

0 Comments

Leave a Comment.