# Show product item cost including tax

If you’d like to display the product item cost with tax included, you can add the following code to [Code Snippets](https://wordpress.org/plugins/code-snippets/) or to the file `functions.php` of your store theme/child theme.

```
add_filter(
    'woocommerce_order_amount_item_subtotal',
    function( $subtotal, $order, $item, $inc_tax, $round ) {
        if ( ! empty( $item ) ) {
            $subtotal = ( (float) $item->get_subtotal() + (float) $item->get_subtotal_tax() ) / $item->get_quantity();
            $subtotal = $round ? \Automattic\WooCommerce\Utilities\NumberUtil::round( $subtotal, wc_get_price_decimals() ) : $subtotal;
            return $subtotal;
        }
        return $subtotal;
    },
    10,
    5
);
```

Excluding tax:&#x20;

<figure><img src="https://157604815-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MJfBhHG_1ipE5lMX4qT%2Fuploads%2FYWIJb184KlAoiEl9LnKA%2Fimage.png?alt=media&#x26;token=cc27dedd-2850-458d-8ab8-ce4f910242d3" alt=""><figcaption></figcaption></figure>

Including tax:

<figure><img src="https://157604815-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MJfBhHG_1ipE5lMX4qT%2Fuploads%2FoKRn467zs058nJE7HzkX%2Fimage.png?alt=media&#x26;token=e655b37f-1655-42d6-b36d-42960309c381" alt=""><figcaption></figcaption></figure>
