WooCommerce - Hide price suffix when product is not taxable.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; | |
} |
Is there a version of this that would work to hide the price prefix if a product is taxable?
does anyone have a version that would simply hide the price suffix when tax is simply zero? I.e. when deliver is within EU countries, website should display the suffix (i.e. incl VAT), but when a customer is outside of EU and gets prices displayed without VAT, the price suffix should be hidden.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Great!