I'm writing a custom .phtml file for a CMS page, in which a list of products is shown with the price of the item, including GST (10%). I've got the items and the prices being output to a table, yet I can't get the tax-inclusive price.
I've read all over the internet that there's two main ways to get tax-inclusive prices:
Mage::helper('core')->currency($product->getFinalPrice())
Mage::helper('tax')->getPrice($product, $product->getFinalPrice(), 2)
Yet trying both of these, all I can get is the ex-GST amount. Tax is set up, and shows on catalog pages, yet no matter what I do I can't get it to show on a CMS page. The code below is what I have on my page, and you can see I've been trying all sorts of combinations with getPrice, getFinalPrice, etc, but it just won't print anything except the exclusive price. Any suggestions would be great.
function construct($catID) {
/* load product collection */
$categoryId = Mage::getModel('catalog/category')->load($catID);
$products = Mage::getModel('catalog/product')->getCollection();
$products->addCategoryFilter($categoryId)->addAttributeToSelect(array('sku','name','price'))->load();
?>
<div class="productTable" id="<?php echo $categoryId->getName(); ?>">
<?php echo "<h3>".$categoryId->getName()."</h3>"; ?>
<table class="table table-bordered table-condensed">
<tr>
<th>Product Name</th>
<th>Price</th>
</tr>
<?php
foreach ($products as $product) {
$name = $product->getName();
$sku = $product->getSku();
$price = Mage::helper('core')->currency($product->getFinalPrice());
?>
<tr>
<td><?php echo $name; ?></td>
<td>
<?php echo Mage::helper('core')->currency($product->getFinalPrice()); ?>
<?php echo Mage::helper('tax')->getPrice($product, $product->getFinalPrice(), 4);?>
<?php echo Mage::helper('tax')->getPrice($product, $product->getFinalPrice(), true);?>
<?php echo Mage::helper('tax')->getPrice($product, $product->getFinalPrice(), false);?>
<?php echo Mage::helper('tax')->getPrice($product, $product->getFinalPrice());?>
<?php echo $product->getFinalPrice();?>
</td>
</tr>
<?php
}
echo "</table></div>";
} /* end construct */
$cpuID = 22;
$memoryID = 23;
$gpuID = 27;
$caseID = 19;
construct($cpuID);
construct($memoryID);
construct($gpuID);
construct($caseID);
?>