{"id":2020,"date":"2022-01-26T10:24:17","date_gmt":"2022-01-26T10:24:17","guid":{"rendered":"https:\/\/meetanshi.com\/blog\/get-available-currency-in-magento-2\/"},"modified":"2025-07-16T16:47:51","modified_gmt":"2025-07-16T11:17:51","slug":"get-available-currency-in-magento-2","status":"publish","type":"post","link":"https:\/\/meetanshi.com\/blog\/get-available-currency-in-magento-2\/","title":{"rendered":"How to Get Available Currency in Magento 2"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Magento 2\u00a0stores support multiple currencies. The admin can\u00a0<a href=\"https:\/\/meetanshi.com\/blog\/magento-2-currency-setup\/\" target=\"_blank\" rel=\"noreferrer noopener\">set multi currency<\/a>\u00a0and default store currency under the store configuration. Sometimes, developers or store owners may require fetching the\u00a0<em><strong>get<\/strong>\u00a0<strong>available currency in Magento 2<\/strong>\u00a0<\/em>for multiple purposes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For an instance, suppose you want to show a drop-down list of all accepted currencies to the customers and want them to choose their preferred one. Thus, you may require to programmatically fetch the list of the allowed currency in Magento 2 and show to the customers. You can also learn to&nbsp;<a href=\"https:\/\/meetanshi.com\/blog\/auto-update-currency-rates-in-magento-2\/\">update currency rates automatically in Magento 2<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Also read:&nbsp;<a href=\"https:\/\/meetanshi.com\/blog\/magento-2-api-get-all-available-currencies\/\" target=\"_blank\" rel=\"noreferrer noopener\">Magento 2 API \u2013 Get All Available Currencies<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this scenario, you can simply make use of the solution below to get the list of the available currencies in Magento 2 and use them as per your convenience.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Method to Get Available Currency in Magento 2:<\/h2>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;!--?php namespace Meetanshi\\Paymulti\\Model\\Source; \/** * Class Currency * @package Meetanshi\\Paymulti\\Model\\Source *\/ class Currency extends \\Magento\\Config\\Model\\Config\\Source\\Locale\\Currency { \/** * @var \\Magento\\Framework\\Locale\\ListsInterface *\/ protected $_localeLists; \/** * @var \\Magento\\Store\\Model\\StoreManagerInterface *\/ protected $_currencySymbol; \/** * @var \\Meetanshi\\Paymulti\\Helper\\Data *\/ protected $_helper; \/** * Currency constructor. * @param \\Magento\\Framework\\Locale\\ListsInterface $localeLists * @param \\Magento\\Store\\Model\\StoreManagerInterface $currencySymbol * @param \\Meetanshi\\Paymulti\\Helper\\Data $helper *\/ public function __construct( \\Magento\\Framework\\Locale\\ListsInterface $localeLists, \\Magento\\Store\\Model\\StoreManagerInterface $currencySymbol, \\Meetanshi\\Paymulti\\Helper\\Data $helper, \\Magento\\Directory\\Block\\Currency $currency ) { $this->_localeLists = $localeLists;\n        $this->_currencySymbol = $currencySymbol;\n        $this->_helper = $helper;\n         $this->_currency = $currency;\n        parent::__construct($localeLists);\n    }\n \n    \/**\n     * @return array\n     * @throws \\Magento\\Framework\\Exception\\NoSuchEntityException\n     *\/\n    public function toOptionArray()\n    {\n        $_supportedCurrencyCodes = $this->_helper->getSupportedCurrency();\n        $_availableCurrencyCodes = $this->_currencySymbol->getStore()->getAvailableCurrencyCodes(true);\n        if (!$this->_options) {\n            $this->_options = $this->_localeLists->getOptionCurrencies();\n        }\n        $options = [];\n        foreach ($this->_options as $option) {\n            if (in_array($option['value'], $_supportedCurrencyCodes) &amp;amp;&amp;amp; in_array($option['value'], $_availableCurrencyCodes)) {\n                $options[] = $option;\n            }\n        }\n        return $options;\n        \n    }\n}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">That\u2019s it!<br>In case you have any queries regarding the above solution or facing any issue while fetching the available currency in Magento 2, feel free to comment down below. I would be happy to assist you!<br>Also, do not forget to share the solution with the Magento community via social media.<br>Thank you!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Magento 2\u00a0stores support multiple currencies. The admin can\u00a0set multi currency\u00a0and default store currency under the store configuration. Sometimes, developers or store owners may require fetching&#8230;<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[34],"tags":[],"class_list":["post-2020","post","type-post","status-publish","format-standard","hentry","category-magento"],"acf":[],"_links":{"self":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/2020","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/comments?post=2020"}],"version-history":[{"count":3,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/2020\/revisions"}],"predecessor-version":[{"id":17992,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/2020\/revisions\/17992"}],"wp:attachment":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/media?parent=2020"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/categories?post=2020"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/tags?post=2020"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}