Is there any possible ways we can use currency svg image on front-end instead of text ?
Note:- Replace in products view, list and cart page etc relaed to all front-end pages only.
Thanks in advance.
Is there any possible ways we can use currency svg image on front-end instead of text ?
Note:- Replace in products view, list and cart page etc relaed to all front-end pages only.
Thanks in advance.
You need to override vendor/magento/module-directory/view/frontend/templates/currency.phtml in your custom theme and need to place at app/design/frontend/{Package}/{Theme}/Magento_Directory/templates/currency.phtml
You need to change following code:
<a href="#" data-post='<?= /* @noEscape */ $block->getSwitchCurrencyPostData($_code) ?>'><?= $block->escapeHtml($_code) ?> - <?= $block->escapeHtml($_name) ?></a> with:
<a href="#" data-post='<?= /* @noEscape */ $block->getSwitchCurrencyPostData($_code) ?>'> <img src="<?php echo $this->getViewFileUrl("images/{$_code}.png"); ?>" alt="<?= $_code ?>"> </a> Also you need to put all currency images like INR.png, USD.png at app/design/frontend/{Package}/{Theme}/web/images folder
Note: Same you need to change for selected currency code as well