Prestashop 1.6.x display language flags

By default in the new Prestashop 1.6.x, languages switcher module does not display flags icons.
By reading this article you will be able to get the same result as this example taken from our theme Linea for Prestashop

Solution

Block languages module modification

There's a simple solution if you want to display a flag next to each language you are using form your eshop made with Prestashop.

Please, follow these steps:

  1. Use your favourite Text Editor like Notepad++ and open blocklanguages.tpl located inside
    /your-online-installation/themes/your-theme/modules/blocklanguages/

    Note: if the folder called blocklanguages does not exist in your theme directory, create this folder inside
    /your-online-installation/themes/your-theme/modules/
    and paste the file called blocklanguages.tpl you copied from
    /your-online-installation/modules/blocklanguages/
  2. Use your favourite Text editor and open blocklanguages.tpl
  3. Change twice (about rows 31 and 46)
    {$language.name|regex_replace:"/s.*$/":""}
  4. with
    <img alt="{$language.iso_code}" height="11" alt="" src="{$img_lang_dir}{$language.id_lang}.jpg" width="16" /> {$language.name|regex_replace:"/s(.*)$/":""}
  5. Save and overwrite
  6. It could be necessary to delete the cache of Prestashop (Advanced Parameters > Performances) and of your browser. (Please, be sure that Recompile templates if the files have been updated is enabled)

Note: do not forget to install your languages and upload flag icons using your Administration Panel > Localization > Languages.

If everything has gone well, you will find your images inside your-online-installation/img/l/

Otherwise you can get flag icons here: www.famfamfam.com/lab/icons/flags/

Theme used in this article

Prestashop Tutorials

Search Engine Optimization

Web Marketing