Navigation überspringen

[Gelöst] Woocommerce changing the text onsale!

Dieser Thread wurde gelöst. Hier ist eine Beschreibung des Problems und der Lösung.

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 vor 4 Jahren, 9 Monaten. 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)

Dieses Thema enthält 2 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von ericK-4 vor 4 Jahren, 9 Monaten.

Assistiert von: Luo Yang.

Author
Artikel
#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!