I am trying to add all country flag in currency change dropdown in magento?
how may i do this in magento 1.4.2 ?
I am trying to add all country flag in currency change dropdown in magento?
how may i do this in magento 1.4.2 ?
Very good example for flags. It may help others http://www.phptechi.com/magento-show-country-flags-selector-in-header.html
As stated in that post:
Step 1: Make sure multiple language stores are available. Now open flags.phhml file located at app/design/frontend/default/theme/template/page/switch/flags.html If in case it does not exists then create it and replace existing code/ add following code into file.
Note: Please modify href & src in following code.
< ?php if(count($this->getGroups())>1): ?> < ?php foreach ($this->getGroups() as $_group): ?> < ?php echo $this->htmlEscape($_group->getName()) ?> < ?php endforeach; ?> < ?php endif; ?>
Step 2: Now add entry into page.xml file and file header block i.e. “html_header”. In case if you want to add flags in footer section then search for footer block and add following line in footer and do little css to align it correctly.
Step 3: Upload flag images into “skin/frontend/currentTheme/images/” directory and make sure the flag file names are having store name is part of flag name. (i.e. Image name is “flagEnglish.gif”, “flagGerman.gif”. So store names are “English”, “German”, etc)
Now clean the magento cache and reload the home page and you are done!!.
Currency selector with flag in magento
In the template file: app/design/frontend/default/your_theme/template/directory/currency.phtml (or app/design/frontend/base/default/template/directory/currency.phtml), change code to:
<?php foreach ($this->getCurrencies() as $_code => $_name): ?>
<a 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="20" />
</a>
<?php endforeach; ?>