How to show prices with AND without taxes in your online store with WooCommerce

woo expert

WooCommerce allows you to display in your online store the prices of the products with OR without taxes, but there is no option to display both, with AND without taxes.

woocommerce tax settings

This is very useful in many types of online stores, especially in those oriented to professionals and companies so why not incorporate this information in your Ecommerce?

To make WooCommerce show the prices of your products with and without taxes, you just have to add some code, this one:

/* Prices with AND without taxes */
add_filter( 'woocommerce_get_price_suffix', 'wphelp_prices_with_and_without_taxes', 99, 4 );
function wphelp_prices_with_and_without_taxes( $suffix, $product, $price, $qty ){
$suffix = ' <small>excluding TAX</small> - ' . wc_price( wc_get_price_including_tax( $product ) ) . ' <small>including TAX</small>';
return $suffix;
}Code language: PHP (php)

What the code does is to add a suffix ($suffix;) in which will go the price with tax and a text indicating it, so in the WooCommerce settings you must have previously activated the option to display prices without tax, like we saw in the screenshot above.

Save the changes and, if you have already applied the above code, you will go from seeing prices only without taxes, to also with taxes.

store prices without taxes
stores prices with and without taxes

The code would be added easily following this guide.

How useful was this post?

Click on a smiley to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

As you found this post useful...

Follow us on social media!

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top