I have 3 websites(.com/, .com/en/ and .com/eu/), each has one store view. And I created Website Switcher using this method.
<?php $websites = Mage::app()->getWebsites(); if (count($websites) > 1): ?> <div class="website-switcher"> <label for="select-website"><?php echo $this->__('Select Store:') ?></label> <select id="select-website" title="<?php echo $this->__('Select Store') ?>" onchange="location.href=this.value"> <?php foreach ($websites as $website): // print out each website name and code as a dropdown box item ?> <?php $_selected = $website->getCode() == Mage::app()->getWebsite()->getCode() ? ' selected="selected"' : '' ?> <option value="<?php echo $website->getDefaultStore()->getBaseUrl()?>"<?php echo $_selected ?>><?php echo $this->htmlEscape($website->getName()) ?></option> <?php endforeach; ?> </select> </div> <?php endif; ?>
Now I want to add another language store view on .com/eu/. However, language switcher is not working. I use the default language switcher. The switcher shows up, but when I try to switch to the new store view, it redirects to the page of .com/ website.
How can I fix this?