WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:

<?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.

share|improve this question

migrated from stackoverflow.com Apr 19 '13 at 5:58

This question came from our site for professional and enthusiast programmers.

up vote 4 down vote accepted


 <?php echo woocommerce_price($product->get_price_including_tax()); ?>
share|improve this answer
Thank you, it's working :) – dmarket Apr 19 '13 at 8:51

protected by Community Sep 17 '13 at 21:32

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.