Product price in magento is calculated dynamically say it by locale or with taxation and/or same with special price. Suppose you have set different currency set up and customized view of price like this.
This code will help to print this type of price by converting price from base currency to store currency
$baseCurrencyCode = Mage::app()->getStore()->getBaseCurrencyCode(); $currentCurrencyCode = Mage::app()->getStore()->getCurrentCurrencyCode(); $price = $_product->getFinalPrice(); $price = Mage::helper('directory')->currencyConvert($price, $baseCurrencyCode, $currentCurrencyCode); $price = explode('.', number_format($price, 2)); echo Mage::app()->getLocale()->currency(Mage::app()->getStore()-> getCurrentCurrencyCode())->getSymbol() . $price; echo $price;// this is float value of price to display separately.
Now suppose you have custom taxation set up on prices. Here is the code how we manage this type of situation. On product view page we have product object defined so, we use it. Here suppose we have to show special price and regular price separately…
$regular = Mage::helper('tax')->getPrice($_product, $_product->getPrice(), true); echo Mage::helper('core')->currency($regular, true, false);
To show special price if special price is set otherwise regular price
$price = Mage::helper('tax')->getPrice($_product, $_product->getFinalPrice(), true); echo Mage::helper('core')->currency($price, true, false);
These first parameter in currency function is format second parameter is for $includeContainer bool variables which include currency symbol by locale and convert price with currency.
We can also combine both of this situation if we needed. I have separated them to elaborate code and include more functions to display variously. Have a nice coding !!