magento – Show country flags selector in header

After spending couple of hours I found one good solution in order to show country flags in website header/ footer section. This blog will guide you on how to show country flags selector in header.
presuming multiple shops are created and are enabled.

quick and easy steps to add country flags in header / footer are as follows.

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!!.

In case if you are not able to see the flags then let me know, i would love to help you.

Share this nice post:

27 thoughts on “magento – Show country flags selector in header

    1. If its default drop down / select list on your page then it will show you the url you have mentioned. First thing when you are creating store store code store be proper because this code is shown to the user. If you wish you customise it you can, change the url format into phtml file and configured your .htaccess rule to understand those url. It should work for you.

  1. Aw, this was a really nice post. In idea I would like to put in writing like this additionally – taking time and actual effort to make a very good article… but what can I say… I procrastinate alot and by no means seem to get something done.

  2. This can be one particular wonderful publish. We are currently seeking adjustable piano bench for own home this also is definately a great benefit!

  3. I simply want to tell you that I’m new to blogging and seriously liked this blog site. Very likely I’m want to bookmark your site . You amazingly come with awesome writings. Cheers for sharing with us your web page.

  4. Way cool! Some extremely valid points! I appreciate you writing this post plus the rest of the site is extremely good.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>