2

I want to get the Finalprice including tax on my productpage for a meta tag.

I currently have this, but that is the price excluding tax:

<?php echo number_format($_product->getpriceIncludingTax(), '2', '.', ',');?>

How can I display the price including tax for this meta?

1 Answer 1

2

Not a direct solution, but some potential pointers/ideas.

Look into the tax helper class. Mage::helper('tax'); There is a method there ->getPrice that may work for you. There are a lot of other interesting methods to look into.

Also have a peek at Mage_Catalog_Block_Product_View_Type_Configurable::getJsonConfig in there you will see some tax related logic that may also be of use/give you some idea of what can be done.

Look towards teh middle of the method, where the code begins with $taxCalculation = Mage::getSingleton('tax/calculation');

Also some potential help here: Mage_XmlConnect_Block_Catalog_Product_Price_Default::collectProductPrices

see the code as follows in that routine:

$price = $taxHelper->getPrice($product, $product->getPrice());
$regularPrice = $taxHelper->getPrice($product, $product->getPrice(), $simplePricesTax);
$finalPrice = $taxHelper->getPrice($product, $product->getFinalPrice());
$finalPriceInclTax = $taxHelper->getPrice($product, $product->getFinalPrice(), true);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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