Webkul
Services
Technologies Bagisto QloApps
iOS Android SAP BigCommerce Wix
Trusted by
Samsung Intel Toyota Walmart Disney Nokia Nestlé Decathlon
See all customers
Back to Top
DOC

Show Different Language Flags instead of Dropdown Magento

1. Goto app/design/frontend/[theme-directory]/template/page/switch/

2. Open file “languages.phtml” replace the code with the following code.

<style type="text/css">
	.langs-wrapper{float:right;height:15px;margin-right:20px;}	 
	.lang-flag{border:1px solid transparent;display:inline-block;height:13px;}	 
	.lang-flag:hover{border:1px solid #FFF;}
</style>
<?php if(count($this->getStores())>1): ?>
<div class="form-language">
    <div class="langs-wrapper">
    <?php foreach ($this->getStores() as $_lang): ?>
        <?php if ($_lang->getCode() != 'default'): ?>
        <a class="lang-flag" href="<?php echo $this->getCurrentUrl().'?___store='.$_lang->getCode();?>" style="text-decoration:none;" title="<?php echo $_lang->getCode();?>">
        	<img src="<?php echo $this->getSkinUrl('images/flags/'.$_lang->getCode().'.gif');?>" alt="<?php echo $_lang->getCode();?>">
        </a>
        <?php endif;?>
    <?php endforeach;?>
    </div>
</div>
<?php endif;?>

3. Put Your Country Flag Images inside “flag” directory in skin/[theme]/images/folder and name it as the store view code.

Enjoy.

. . .

Leave a Comment

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


Be the first to comment.

Back to Top

Message Sent!

If you have more details or questions, you can reply to the received confirmation email.

Back to Home