Dear Support,
i would like to change the Woocommerce “Sale Text” into a percentage notice, like “-40%” instead of just “Sale!”. Would be great if you have a code for this issue?
Thanks!
Hey UPON,
Please refer to the following:
Best regards,
Jordan Shannon
Thank you. I found this too.
The percentage notice appears on top of the title. Do you have a code for putting the percentage notice instead of the Sale Text?
Best regards
Hi,
Thank you for the inquiry.
That is possible but you may need to use a “discount” plugin.
// https://wordpress.org/plugins/woo-discount-rules/
If you only need to change the text in the sales badge, this code should help.
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 );
}
Best regards,
Ismael
Thank you!
Yes we can close it. Thanks!
Hi,
If you need additional help, please let us know here in the forums.
Best regards,
Jordan Shannon