Skip Navigation

[Resolved] Woocommerce changing the text onsale!

This thread is resolved. Here is a description of the problem and solution.

Problem:

I want to change the text on sale for product in a woo shop

Solution:

The shortcode [wpv-woo-onsale] does not use filter "woocommerce_sale_flash", please try with anther filter hook "wpv_woo_onsale_text_display_override" of "Toolset WooCommerce Blocks" plugin, for example:

https://toolset.com/forums/topic/woocommerce-changing-the-text-onsale/#post-1706403

Relevant Documentation:

This support ticket is created 4 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 2 replies, has 2 voices.

Last updated by ericK-4 4 years, 6 months ago.

Assisted by: Luo Yang.

Author
Posts
#1706375

Hello
I want to change the text on sale for product in a woo shop
I use the shortcode [wpv-woo-onsale] in a view and this in function.php
add_filter('woocommerce_sale_flash', 'woocommerce_custom_sale_text', 10, 3);
function woocommerce_custom_sale_text($text, $post, $_product){
return '<span class="onsale">Promo</span>';
}
and it doesn't work
Thanks for your support

#1706403

Hello,

The shortcode [wpv-woo-onsale] does not use filter "woocommerce_sale_flash", please try with anther filter hook "wpv_woo_onsale_text_display_override" of "Toolset WooCommerce Blocks" plugin, for example:

add_filter('wpv_woo_onsale_text_display_override', 'woocommerce_custom_sale_text');
function woocommerce_custom_sale_text($text){
return 'Promo';
}

And test again

#1706447

My issue is resolved now. Thank you!