I have this code to get the price of related products in new order email:
<?php echo Mage::getResourceModel('catalog/product')->getAttributeRawValue($relatedProductId, 'price', $storeId); ?>
It outputs the price but in the incorrect format like this 19.9700 with extra zeros. I've tried several ways to get it to remove the extra zeros but everything I can find Google doesn't show how this is done with getAttributeRawValue. How can I get the show the correct price format like 19.97? Thank you
$collection->addPriceData()
, then use$product->getFinalPrice()
on the collection items. This fetches all price data from the price index and applies group price, special price etc.