Okay
  Public Ticket #4519641
Hiding sales badges
Open

Comments

  • Kjetil Toth started the conversation

    Hi. I want to hide the sales badges for all B2B customers on my site. When I put in dynamic discount on the B2B customers the Sales Badges automaticly appares on my sites.
    I need a code to make them disapare.


    Please helpĀ 

    Attached files:  fdb222a7-6b9d-4817-8e5d-a2f63b1ee702.png
      65bc0a0d-df4d-4f32-9d6e-af3bbc6be0da.png

  •  2,598
    WebWizards replied

    Hi Kjetil,

    Thank you for purchasing our plugin!

    Indeed, when dynamic rule discounts are applied, they show as a sale price with a badge by default. To hide the badges for these discount rules, please add this code snippet to your theme's functions.php or any code snippets plugin:

    add_filter('b2bking_dynamic_recalculate_sale_price_badge', '__return_false');

     

    Additionally, if you'd like, it is also possible to show only the discounted price (without the old price crossed out, not appearing 'on sale'). For that you can add this snippet:

    add_filter('b2bking_dynamic_recalculate_sale_price_display', function($price_html, $product, $sale_price){
    return wc_price($sale_price);
    }, 10, 3);

    This way the price will simply appear as a regular price.

     

    Let me know if this works for you or if you need any adjustments,

    Kind regards,
    Stefan