I am having an extension that shows the products on main page in tabs. It uses the following code to get the price of product
$price = $_product->getPrice();
and then uses the following code to display it
echo '<span class="price">'.number_format($price,2).'</span>'
It works OK on the base currency but when another currency is selected it will not convert the price to that currency.
How can I show the price in current currency instead?
Try this
$price = number_format($price,2);
$formatedPrice = Mage::helper('core')->currency($price, true, false);
echo '<span class="price">'.$formatedPrice.'</span>'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With