How To Change Sale Badge Text In WooCommerce?

Sale badge text can help you to increase your conversion rate. You can drive more sales by using other attractive words such as Going-fast, Deal, Best-seller, Brand-new, Limited, Rare, Last. Sometimes you may want to change the default WooCommerce badge sale text. Well, that’s easy. There’s a filter for that.


function lionplugins_change_sale_text( $content, $post, $product ) {
	$content = '' . __( 'Best-selling', 'lionplugins' ) . '';

	return $content;
}
add_filter( 'woocommerce_sale_flash', 'lionplugins_change_sale_text', 10, 3 );

You may also want to change the sale text only for products that are in a certain category. You can do that by using has_term function to check a product category, example:


if ( has_term( 'sale', 'product_cat', $product->get_id() ) ) { 
  $content = '' . __( 'Best-selling', 'lionplugins' ) . '';
}

Leave a Reply

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