Public Ticket #2890519

Filter hook for Variants Price

Closed
Comments
5 Tickets 5
Sean King started the conversation 5 years ago on October 8, 2021 at 5:54pm

Hey Stefan - 

This is not urgent. Attached is a screen of my site and dev tools... I am trying to target the text with class: "b2bking_tiered_active_price" with a filter so that I can prepend some text on to it.  This is the variant tiered price that auto-updates as you increase quantities... It's the price that's right above the tiered price table.  Is it possible to target this?  I tried looking at the hooks generated on the page but could not isolate it.  Can you let me know if this is possible and what I can target?

Thank you!

2,762
KingsPlugins replied 5 years ago on October 9, 2021 at 12:50pm

Hi Sean,

Text with b2bking_tiered_active_price is mostly handled via JavaScript. E.g.:

7777275584.png


I can add a prefix variable in the JS and then a filter in the PHP. Do you need the product / variation ID as a parameter for the filter? what exactly are you trying to prepend?


Would something like this work for you?

add_filter('b2bking_tiered_active_price_prefix', function($prefix, $productid){
    return $prefix;
}, 10, 2);


Kind regards,

Stefan

Sign In