Okay
  Public Ticket #2890519
Filter hook for Variants Price
Closed

Comments

  •  5
    Sean King started the conversation

    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,218
    WebWizards replied

    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