Magento: Get currency code & currency rate

Here are the code snippets to get base currency code, default currency code, current currency code, all allowed currency code and current currency rate in Magento.

Base currency is the currency that is used for online transaction from your store.

Default currency is the currency used to display pricing in your store.

Current currency is the currency currently chosen by the user for displaying price in the store.

Get Base Currency Code


Mage::app()->getStore()->getBaseCurrencyCode();

Get Default Currency Code


Mage::app()->getStore()->getDefaultCurrencyCode();

Get Current Currency Code


Mage::app()->getStore()->getCurrentCurrencyCode();

The following code fetches a list of all the allowed currencies.

Get Available/Allowed Currency Codes


$availableCurrencyCodes = Mage::app()->getStore()->getAvailableCurrencyCodes();
print_r($availableCurrencyCodes);

The following code fetches currency rate of current currency with respect to base currency. Suppose, your base currency is USD and your current currency is EUR. Current exchange rate is 1 USD = 0.86 EUR. Then, current currency rate will be 0.86.

Get Current Currency Rate


Mage::app()->getStore()->getCurrentCurrencyRate();

Hope this helps.
Thanks.