WooCommerce by default does not come with an option to display the product total inclusive of tax in the order details page. Seeing as that’s also one of the popular requests in the WooCommerce.com ideas board, I’ve gone ahead and created a small plugin that would let users see the Product total right next to the product name:
Note that in the screenshot above, Item total = ( Cost * Qty ) + Tax total. This is the actual product total paid by the customer, and Cost = Price of the product minus Discounts (if any)
- Install the plugin and activate it. No further configuration is required.
How did you add the details there?
I made use of two action hooks:
woocommerce_admin_order_item_headers to add the table Header, and
woocommerce_admin_order_item_values to add the tax value.
What did you learn?
- wc_get_order() can be used to grab all the order details as long as you have the order ID
- wc_price() Formats a passed price with the correct number of decimals and currency symbol.
Feel free to share your thoughts in the comment below. If you find an issue/bug though, please report it as an issue in the repo.