How to change woocommerce product badge text

Step: Login to WordPress dashboard > and go to the Appearance > themes editor > Find function.php file and open this file > Put the code at the bottom functions.php file

Example: Look at the code here. Changed the “Sale” text to Kampanja. (Change the “Sale!” text to what you want to write in place of kampanja)

Note: If you are using a child theme. It’s better to code implementation. Otherwise, the code is gone when your main theme needs to update or update your theme.

Attached screenshot here:

WooCommerce Product Badge Change
add_filter( 'woocommerce_sale_flash', 'wc_custom_replace_sale_text' ); 
function wc_custom_replace_sale_text( $html ) { 
return str_replace( __( 'Sale!', 'woocommerce' ), __( 'Kampanja', 'woocommerce' ), $html ); 

} 

Leave a Reply

Your email address will not be published.

fifteen − ten =