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.

Note: This guide explains how WooCommerce displays tax totals. It does not determine what tax to charge or when to charge it. For advice about your tax obligations, consult a qualified tax professional or accountant.

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.

Questions and support

↑ Back to top

Do you still have questions and need assistance? 

This documentation is about the free, core WooCommerce plugin, for which support is provided in our community forums on WordPress.org. By searching this forum, you’ll often find that your question has been asked and answered before.

If you haven’t created a WordPress.org account to use the forums, here’s how.

  • If you’re looking to extend the core functionality shown here, we recommend reviewing available extensions in the WooCommerce Marketplace.
  • Need ongoing advanced support or a customization built for WooCommerce? Hire a Woo Agency Partner.
  • Are you a developer building your own WooCommerce integration or extension? Check our Developer Resources.

If you weren’t able to find the information you need, please use the feedback thumbs below to let us know.

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.