By using Magento’s Directory Helper class, you can easily convert between available currencies.
You have to make sure that you have loaded the exchange rates for the currencies you are converting.
// Currency conversion rates have to be available in the target currency $fromCur = 'USD'; // currency code to convert from - usually your base currency $toCur = 'EUR'; // currency to convert to $price = Mage::helper('directory')-> currencyConvert($tax->getPrice($product, $product->getFinalPrice(), false), $fromCur, $toCur); // if you want it rounded: $converted_final_price = Mage::app()->getStore()->roundPrice($price);
Originally published on magebase.com. Copyright © 2010 Magebase - All Rights Reserved.