0

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.

1
  • hey @Denish do you find any solution for it ? Commented Mar 31 at 6:59

1 Answer 1

0

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

1
  • Thank You for your reply. but i require to apply changes in product prices. Commented Mar 6 at 7:44

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.