Please submit a private ticket if you need to share sensitive information, such as license details and admin credentials.

Okay
  Public Ticket #2663044
Change "SALE" label on product bundle
Closed

Comments

  • Tobias started the conversation

    Hi!

    Is it possible to change "SALE" label on bundled products? I want to change it to dynamically insert % discount instead.

  •  767
    Janilyn replied

    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

  • Tobias replied

    Any news on this one?

  • tailwind replied

    Hi, any update on this issue? If so it would be cool to post a solution here for others to check

  • Tobias replied

    Still awaiting some reply.

  • tailwind replied

    WPC support, can we get some update on this issue? It would be cool if it's solvable

  • tailwind replied

    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.

  •  153
    Henry replied

    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.