Magento storeswitch - flags


/ Published in: PHP
Save to your folder(s)

- Mage 1.7* flag storeswitcher
- images/flags/flag_[storeview_name].png


Copy this code and paste it in your HTML
  1. <?php if(count($this->getStores())>1): ?>
  2. <div class="form-language">
  3. <!--span class="label"><?php echo $this->__('Your Language:') ?></span-->
  4. <ul class="language-flags">
  5. <li class="label"><?php echo $this->__('Your Language:') ?></li>
  6. <?php foreach ($this->getStores() as $_lang): ?>
  7. <?php $_selected = ($_lang->getId() == $this->getCurrentStoreId()) ? ' class="selected"' : '' ?>
  8. <li><a href="<?php echo $_lang->getCurrentUrl(false) ?>" title="<?php echo $this->htmlEscape($_lang->getName()) ?>">
  9. <img src="<?php echo $this->getSkinUrl() ?>images/flags/flag_<?php echo $this->htmlEscape($_lang->getCode()) ?>.png" alt="<?php echo $this->htmlEscape($_lang->getName()) ?>"<?php echo $_selected; ?> />
  10. </a></li>
  11. <?php endforeach; ?>
  12. </ul>
  13. </div>
  14. <?php endif; ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.