Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
WooCommerce - Hide price suffix when product is not taxable.
<?php // Do not include this if already open!
/**
* Code goes in theme functions.php.
*/
add_filter( 'woocommerce_get_price_suffix', 'custom_woocommerce_get_price_suffix', 10, 2 );
function custom_woocommerce_get_price_suffix( $price_display_suffix, $product ) {
if ( ! $product->is_taxable() ) {
return '';
}
return $price_display_suffix;
}
@quirinpils

This comment has been minimized.

Copy link

quirinpils commented Apr 1, 2017

Great!

@dumlaut

This comment has been minimized.

Copy link

dumlaut commented Jun 8, 2018

Is there a version of this that would work to hide the price prefix if a product is taxable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.