I am using WooCommerce for WordPress and I'm listing items excluding Tax.
I need to show separately the Price (without tax), the Tax and the PRICE + Tax on the product page (like in checkout page).
I have not been able to find a plugin that does this.
How can I do this?
Enabling Taxes To access the tax settings screens, they first need to be enabled. Go to: WooCommerce > Settings > General. Select the Enable Taxes and Tax Calculations checkbox. Save changes.
Go to WooCommerce → Settings → Variation Prices and select the 'Custom' format for your variation prices. In the field that appears below, enter the required format for how you would like to display the variation prices.
Under the WooCommerce menu, go to Role Based pricing > Tax Options. Under the tax options you can see different user roles and the tax class associated to it, and also the tax type to show hide tax in shop/ cart page.
WooCommerce v3.0.0 and Later
As of WooCommerce version 3.0, the function woocommerce_price() is deprecated, as is the method get_price_including_tax(). Instead, you should use wc_get_price_including_tax:
<?php echo wc_price( wc_get_price_including_tax( $product ) ); ?>
Prior to WooCommerce v3.0.0
You need to modify a template. Do not modify the core WooCommerce template, but rather make a copy of it to your theme, using the WooCommerce template override system. For help with that, refer to the WooCommerce docs on using the template override system.
In the price.php
template, you will add this bit of code where you want the price, including tax (VAT):
<?php echo woocommerce_price( $product->get_price_including_tax() ); ?>
Note: the price.php
template that you modify should be located here in wp-content/themes/[your theme folder]/woocommerce/single-product/price.php
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With