0

My code is

<?php if($this->getCurrencyCount()>1): ?>  
<div class="header_currency">
    <div class="currency_box">
      <div class="currency_pan"> <i class="hideIcon fa fa-money"></i><span><?php echo Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol(); ?> - <?php echo $this->getCurrentCurrencyCode()?>      

       </span><i class="fa fa-sort-down"></i></div>
      <div class="currency_detail">
        <div class="currency-inner">
        <?php foreach ($this->getCurrencies() as $_code => $_name): ?>
        <a title="<?php echo $_name ?>" class="currency_icon  <?php if($_code==$this->getCurrentCurrencyCode()): ?> selected<?php endif; ?>" href="<?php echo $this->getSwitchCurrencyUrl($_code) ?> " onclick="setLocation(this.value);"> <img src="<?php echo Mage::getBaseUrl('media').'flag/'.$_code.'.jpg'; ?>" title="<?php echo $_name ?> - <?php echo $_code ?>" alt="<?php echo $_name ?> - <?php echo $_code ?>" width="20" height="17" /> <?php echo Mage::app()->getLocale()->currency($_code)->getSymbol()?> <span>- <?php echo $_name ?></span></a>
        <?php endforeach; ?>

I want to change flag in header too.

enter image description here

some thing like :

enter image description here

8
  • its not clear what you want ? – inrsaurabh Mar 27 '18 at 9:56
  • have a look to this magento.stackexchange.com/questions/3032/… – inrsaurabh Mar 27 '18 at 9:56
  • i want to show country flag on top of drop down like if i am selecting EURO from drop down list then flag will show in header also (before currency code) – web shubh Mar 27 '18 at 9:58
  • you want to show the falg of selected country , like when you select EURO than after selection flag must be shown beside the currency code ? – inrsaurabh Mar 27 '18 at 10:00
  • yes but in header, in drop down its already showing . u can see in screenshot. – web shubh Mar 27 '18 at 10:04
0

May be its not the perfect solution but

whenever we change the currency a cookie is created VIZ currency.

You can change the flag image based on cookies in header part beside the dropdown.

Put all flag images under a folder like below and based on current cookie value change the flag image name.

http://yourwebsite.in/skin/frontend/rwd/yourtheme/flags/USD.jpg

To get Media URL Media URL

Like : Mage::getBaseUrl('skin')

3
  • any Code for image fetch ????? – web shubh Mar 27 '18 at 10:48
  • i updated my suggestion with the link from where you can learn about magento urls – inrsaurabh Mar 27 '18 at 11:00
  • If this helped you can mark it as accepted or I will try to update of code. – inrsaurabh Mar 29 '18 at 14:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.