Are Discount Plugins supported?

FAQ Filter & Hooks Viewed: 314

We use the woocommerce standard get_price_html function to get the price for a product. If your 3rd party plugin hooks into this function it will work.

You could hook yourself into the filter applied there like the following:

// define the woocommerce_get_price_html callback 
function filter_woocommerce_get_price_html( $price, $instance ) { 
 
 if($instance->get_id() == 96) {
 $price = '40 €';
 }
 return $price; 
}; 
 
// add the filter 
add_filter( 'woocommerce_get_price_html', 'filter_woocommerce_get_price_html', 10, 2 );
This Post Has 0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *