magento - convert order amount from current currency to base currency
magento-1.7
Solution
UPDATE
try this code, may help you. for this case I use total amount. and will change if the base currency different with current curency.
$amount = $this->getOrder()->getGrandTotal();
$baseCurrencyCode = Mage::app()->getStore()->getBaseCurrencyCode();
$currentCurrencyCode = Mage::app()->getStore()->getCurrentCurrencyCode();
if ($baseCurrencyCode != $currentCurrencyCode) {
// convert price from current currency to base currency
$amount = Mage::helper('directory')->currencyConvert($amount, $currentCurrencyCode, $baseCurrencyCode);
// convert price from base currency to current currency
//$priceTwo = Mage::helper('directory')->currencyConvert($amount, $baseCurrencyCode, $currentCurrencyCode);
}
$amountFinal = round($amount, 2);
Problem
I am trying to convert order amount from current currency to base currency, below is the code which i tried, but no go. ``` $baseCurrencyCode = Mage::app()->getStore()->getBaseCurrencyCode(); $currentCurrencyCode = Mage::app()->getStore()->getCurrentCurrencyCode(); $price = 1; $priceTwo = Mage::helper('directory')->currencyConvert($price, $baseCurrencyCode, $currentCurrencyCode); ```