Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save fabiomsnunes/83dc3fd995898dcc6099d3d5fef40fbb to your computer and use it in GitHub Desktop.
Save fabiomsnunes/83dc3fd995898dcc6099d3d5fef40fbb to your computer and use it in GitHub Desktop.
WooCommerce - Show price without tax on price suffix
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