Woocommerce price including tax with formatting from options

Af first, I’m not a programmer. In Woocommerce I need to display both product prices, including tax and excluding tax. Code in price.php

<?php if ( $price_html = $product->get_price_html() ) : ?>

is showing default price we entered as product price (this price is excluding tax). I have a problem with displaying price including tax – I’m using this code I found at stackoverflow:

Read More
<?php echo $product->get_price_including_tax(); ?>

But the price this code is showing is without formatting and currency I set in Woocommerce settings. Can you help me with this? How to display price_including_tax with proper formatting and currency? I will use this code in some woocommerce template pages, I’d like to avoid editing functions or classes if possible.

Related posts

Leave a Reply

2 comments

  1. woocommerce_price() is deprecated since version 3.0.
    You can use wc_price() instead :

    <?php echo wc_price($product->get_price_including_tax()); ?>