We are doing custom Magento themes, Magento design, custom Magento extensions and creative services through Magento designers & developers for worldwide shop owners.

Last News
Magento  about Currency , base currency , current currency ,  currency symbol and convert currency

Magento about Currency , base currency , current currency , currency symbol and convert currency

in our last project we need know more about how convert currency form one to other , how get base currency how get current currency , get currency symbol by currency code .

1 – Convert currency

1
2
3
$from = 'SAR';
$to = 'USD';
$total = Mage::helper('directory')->currencyConvert('100.00', $from, $to);

2 – Get base currency code :

1
$baseCurrency = Mage::app()->getStore()->getBaseCurrencyCode();

3 – Get Current currency code :

1
$currentCurrency = Mage::app()->getStore()->getBaseCurrencyCode();

4 – Get allowed currency for a store :

1
2
$currencyModel = Mage::getModel('directory/currency'); 
$currencies = $currencyModel->getConfigAllowCurrencies();

5 – Get currency symbol by currency code :

1
$currency_symbol = Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol();

or

1
2
$curr = new Zend_Currency('en_US');
$currency_symbol = $curr->getSymbol();

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*