In this video I’ll address the question “Should I Show WooCommerce Prices Inc or Ex TAX?”.
In the UK we pay a sales tax called VAT (value added tax). It is collected by the company and paid to HMRC (His Majesties Revenue and Customs) the UK version of the IRS.
For consumers buying products they need to suck it up and pay the tax, but for companies that are VAT registered they can reclaim that money, so in the UK it really depends upon on the the type of customer you sell to whether or not to inc/ex tax. B2C I recommend showing prices inc of tax, for B2B show it ex.
In this video I’ll show you how to do both and I’ll add in a third custom solution where you can add a code snippet to show both.
Video
Code Snippet
Here’s the code snippet I used in my demo. Copy and paste this into your functions.php file in your theme, or use the code snippet plugin.
add_filter( 'woocommerce_get_price_html', 'nm_excl_incl_tax', 9999, 2 );
function nm_excl_incl_tax( $price, $product ) {
if ( wc_tax_enabled() ) {
if ( 'incl' === get_option( 'woocommerce_tax_display_shop' ) ) {
$price = wc_price( wc_get_price_including_tax( $product ) ) . ' <small class="woocommerce-price-suffix">' . WC()->countries->inc_tax_or_vat() . '</small>';
} else {
$price = wc_price( wc_get_price_excluding_tax( $product ) ) . ' <small class="woocommerce-price-suffix">' . WC()->countries->ex_tax_or_vat() . '</small>' . '<br/>' . 'Incl. Tax: ' . wc_price( wc_get_price_including_tax( $product ) );
}
}
return $price;
}
You can use my code snippet generator as seen in the video from this link WooCommmerce Code Generator. It’s free to use and will create a woocommerce code snippet from plain English.
Here’s a link to my post on using the code snippet plugin. Check out the video on how to install the code snippet plugin and how to add the snippet you generate or copy from above.
Wrap Up – Should I Show WooCommerce Prices Inc or Ex TAX?
It really depends upon your audience but I hope I have given you enough options to show or hide that pesky tax rate on your WooCommerce store.
If you need help with your WooCommerce tax setup why not hire me. I offer development services and WooCommerce maintenance.
Photo by Bermix Studio on Unsplash