Created
July 22, 2022 13:32
-
-
Save fabiomsnunes/83dc3fd995898dcc6099d3d5fef40fbb to your computer and use it in GitHub Desktop.
WooCommerce - Show price without tax on price suffix
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
function show_price_without_tax($price_html, $product) | |
{ | |
if (is_product() && wc_prices_include_tax()) | |
return sprintf(__('%1$s', 'woocommerce'), wc_price(wc_get_price_excluding_tax($product), array('ex_tax_label' => true))); | |
return $price_html; | |
} | |
add_filter('woocommerce_get_price_suffix', 'show_price_without_tax', 999, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment