Show Tax row in my invoice using Woocommerce Print

2019-03-06 10:40发布

问题:

I opened a previous thread about forcing WooCommerce to show the Tax name in the checkout page of WooCommerce even if the rate is 0.000%, as I need that information to be displayed (VAT rates in my store are always 0% due to a VAT extemption regime, but it needs to be displayed). See the image below about how Taxes are currently managed:

I used this code in my function.php file to force WooCommerce to display the Tax name in Cart or during Checkout:

add_filter( 'woocommerce_cart_hide_zero_taxes', '__return_false' ); 

It works, and this is the result, the Tax name is displayed right before the Total row:

The problem comes when using the extension called Woocommerce Print Invoices & Packing lists, which is supposed to show the same stuff during the checkout, but the table row about Taxes is completely missing, check how the table appears in the Invoice:

Any ideas to force the displaying of the Tax name like the Checkout example above? Any help is appreciated.

回答1:

I think I found the answer. This worked for me with 'WooCommerce PDF Invoices and Packing Slips'.

WooCommerce PDF Invoice showing zero tax

Add this line to functions.php to display zero tax on the site:

add_filter( 'woocommerce_cart_hide_zero_taxes', '__return_false' ); 

Add this line to display zero tax on your invoices:

add_filter( 'woocommerce_order_hide_zero_taxes', '__return_false' );

I hope this works for you.