Show zero-value tax lines in order totals

Use this filter to retain zero-value tax totals when WooCommerce builds an order’s tax-total rows. It does not change the tax calculation or make every cart and checkout tax line visible.

Note:

This is a Developer level doc. If you are unfamiliar working with code and resolving potential conflicts, we recommend you work with a Woo Agency Partner for larger projects, or find a WooCommerce developer on Codeable for smaller customizations. We are unable to provide support for customizations under our Support Policy.

This documentation covers how to set up tax rates in WooCommerce, as well as how the platform handles taxes/VAT/GST based on these settings — not when or what to charge.

We are not tax professionals; our advice only applies to how to use our software. For advice on what — or when — to charge tax/VAT/GST etc., we recommend consulting a tax professional or accountant.

Every business is unique, and we are unable to cover all possibilities here.

Before you start

↑ Back to top

Create a test order with an actual zero-percent tax rate and a saved tax line. An order with no tax lines does not gain one from this filter. Themes, emails, and extensions that use a different totals renderer may behave differently.

Test on a staging store first. Back up the store and add the snippet through a custom plugin or a snippet-management plugin. Keep a way to disable it if the site fails to load; avoid editing WooCommerce or a parent theme.

Add the snippet

↑ Back to top
/**
 * Show zero-value tax lines in order totals.
 *
 * @package WooCommerce\Docs
 */

add_filter( 'woocommerce_order_hide_zero_taxes', '__return_false' );

Verify the result

↑ Back to top

Compare the order details and order email for a test order with a zero-value tax line before and after enabling the snippet. The line should be retained where the renderer uses WooCommerce order tax totals. Confirm that the order total and tax amounts do not change.

Remove or troubleshoot the change

↑ Back to top

Disable the snippet and repeat the same test to restore the default behavior. If the result differs, check the tax settings and conflicting customizations before changing the code. Clear relevant caches and test in separate customer sessions.

Use of your personal data
We and our partners process your personal data (such as browsing data, IP Addresses, cookie information, and other unique identifiers) based on your consent and/or our legitimate interest to optimize our website, marketing activities, and your user experience.