Magento language switcher
this is below phtml code for magento
<?php if(count($this->getGroups())>1): ?>
<div class="language-switcher" style="margin-left:15px">
<label for="select-store"><?php echo $this->__('Select Store') ?>: </label>
<select id="select-store" onchange="location.href=this.value">
<?php /*foreach ($this->getStores() as $_store): ?>
<option value="<?php echo $_store->getUrl('') ?>"<?php if($_store->getId()==$this->getCurrentStoreId()): ?> selected="selected"<?php endif; ?>><?php echo $_store->getName() ?></option>
<?php endforeach;*/ ?>
<?php foreach ($this->getGroups() as $_group): ?>
<?php $_selected = ($_group->getId()==$this->getCurrentGroupId()) ? 'selected="selected"' : '' ?>
<option value="<?php echo $_group->getHomeUrl() ?>" <?php echo $_selected ?>><?php echo $this->htmlEscape($_group->getName()) ?></option>
<?php endforeach; ?>
</select>
</div>
<?php endif; ?>
this is below phtml code for magento
<?php if(count($this->getGroups())>1): ?>
<div class="language-switcher" style="margin-left:15px">
<label for="select-store"><?php echo $this->__('Select Store') ?>: </label>
<select id="select-store" onchange="location.href=this.value">
<?php /*foreach ($this->getStores() as $_store): ?>
<option value="<?php echo $_store->getUrl('') ?>"<?php if($_store->getId()==$this->getCurrentStoreId()): ?> selected="selected"<?php endif; ?>><?php echo $_store->getName() ?></option>
<?php endforeach;*/ ?>
<?php foreach ($this->getGroups() as $_group): ?>
<?php $_selected = ($_group->getId()==$this->getCurrentGroupId()) ? 'selected="selected"' : '' ?>
<option value="<?php echo $_group->getHomeUrl() ?>" <?php echo $_selected ?>><?php echo $this->htmlEscape($_group->getName()) ?></option>
<?php endforeach; ?>
</select>
</div>
<?php endif; ?>
No comments:
Post a Comment