Comments Tobias started the conversationJanuary 18, 2021 at 5:17pmHi! Is it possible to change "SALE" label on bundled products? I want to change it to dynamically insert % discount instead. 767Janilyn repliedJanuary 19, 2021 at 9:27amHi Tobias, Thank you for contacting WPClever Support Forum. We’ve received your ticket and assigned one of our developers to help you with that. He’ll be looking into your question and responding with specific instructions as soon as possible. Please stay patient as we're having very heavy workloads, it might take some time for our developers to reach back. Best regards.Janilyn T. - WPClever Support AgentTobias repliedJanuary 27, 2021 at 3:21pmAny news on this one?tailwind repliedMarch 1, 2021 at 12:38pmHi, any update on this issue? If so it would be cool to post a solution here for others to checkTobias repliedMarch 1, 2021 at 12:55pmStill awaiting some reply.tailwind repliedMarch 1, 2021 at 2:26pmWPC support, can we get some update on this issue? It would be cool if it's solvabletailwind repliedMarch 1, 2021 at 3:05pmTobias, try this solution https://stackoverflow.com/questions/52558950/display-the-discount-percentage-on-the-sale-badge-in-woocommerce-3This will override the percentage discount option from your theme, for products, and will include the percentage on bundle products. Just tested it, and works fine for me. 153Henry repliedMarch 1, 2021 at 5:49pmYou can try this code:add_filter('woocommerce_sale_flash', 'woosb_onsale_percent', 10, 3);function woosb_onsale_percent($text, $post, $product){ if ( $product->is_type( 'woosb' ) ) { $max_percentage = ( ( $product->get_regular_price() - $product->get_sale_price() ) / $product->get_regular_price() ) * 100; $text = round($max_percentage)."%"; } return '<span class="onsale">'.$text.'</span>';}Best regards,Henry N. Sign in to reply ...
Hi!
Is it possible to change "SALE" label on bundled products? I want to change it to dynamically insert % discount instead.
Hi Tobias,
Thank you for contacting WPClever Support Forum.
We’ve received your ticket and assigned one of our developers to help you with that.
He’ll be looking into your question and responding with specific instructions as soon as possible.
Please stay patient as we're having very heavy workloads, it might take some time for our developers to reach back.
Best regards.
Janilyn T. - WPClever Support Agent
Any news on this one?
Hi, any update on this issue? If so it would be cool to post a solution here for others to check
Still awaiting some reply.
WPC support, can we get some update on this issue? It would be cool if it's solvable
Tobias, try this solution https://stackoverflow.com/questions/52558950/display-the-discount-percentage-on-the-sale-badge-in-woocommerce-3
This will override the percentage discount option from your theme, for products, and will include the percentage on bundle products. Just tested it, and works fine for me.
You can try this code:
add_filter('woocommerce_sale_flash', 'woosb_onsale_percent', 10, 3);
function woosb_onsale_percent($text, $post, $product){
if ( $product->is_type( 'woosb' ) ) {
$max_percentage = ( ( $product->get_regular_price() - $product->get_sale_price() ) / $product->get_regular_price() ) * 100;
$text = round($max_percentage)."%";
}
return '<span class="onsale">'.$text.'</span>';
}
Best regards,
Henry N.