Magento – Magento 2 Currency Switch Dropdown – Remove currency name

currencymagento2

In Magento 2 (Luma child theme) when enabling multiple currencies you get a currency switcher dropdown in the frontend's header.
By default, it shows the currency code followed by the full name,

e.g. GBP – British Pound Sterling.

I want to keep GBP, USD etc.
But remove the rest as I think it's unnecessary, customers can tell the currency from the code.
I am new to Magento 2 and can't find where in the template or layout files this can be changed.

Any idea?

Best Answer

copy file:

mage2Root/vendor/magento/module-directory/view/frontend/templates/currency.phtml

to

app/design/frontend/{Package}/{theme}/Magento_Directory/templates/currency.phtml

After that you need to remove Currency code.

Code responsible for showing currency code is:

- <?= @$block->escapeHtml($currencies[$currentCurrencyCode]) ?>

Above code will remove active currency code. For other currency code you need to remove:

- <?= $block->escapeHtml($_name) ?>

from li

Before edit:

enter image description here

After Edit:

enter image description here

Hope above will help!

Related Topic