Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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
add comment

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

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

1 Answer

up vote 1 down vote accepted

Try:

 <?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
add comment

protected by Community Sep 17 '13 at 21:32

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

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.