1

On this multisite I have a store switcher (select list). Now I am able to switch between the stores and share the shopping cart. I want to change the select list in buttons.

My storeswitcher.phtml looks like this:

<?php
/**
 * @see Lucus_Foodisgood_Block_Storeswitcher
 * @var $this Lucus_Foodisgood_Block_Storeswitcher
 */
?>
<script type="text/javascript">
    function lucusStoreswitcher(obj) {
        var url = obj.options[obj.selectedIndex].value;
        window.location = url;
    }
</script>
<div class="lucus-store-switcher">
    <label for="lucus_store_switcher"><?php echo $this->__('Continue shopping at:') ?></label>
    <select title="><?php echo $this->__('Continue shopping at:') ?>" name="lucus_store_switcher" onchange="lucusStoreswitcher(this)">
        <?php foreach ($this->getStores() as $storeId => $store) : ?>
            <option <?php if ($this->isCurrentStore($storeId)) : ?>selected="selected"<?php endif ?> value="<?php echo $store['url'] ?>"><?php echo $store['name'] ?></option>
        <?php endforeach ?>
    </select>
</div>

How do I translate this into buttons/links:

<a href="" class="button">Shop 2</a> 
<a href="" class="button">Shop 3</a>

1 Answer 1

1

copy stores.phtml from app\design\frontend\base\default\template\page\switch

to app\design\frontend\themepackage\theme\template\page\switch

and replace with following code;

<?php if(count($this->getGroups())>1): ?>
<div class="store-switcher">
    <label for="select-store"><?php echo $this->__('Select Store:') ?></label>
<ul class="store-selector-ul">
<?php foreach ($this->getGroups() as $_group): ?>
<?php $_selected = ($_group->getId()==$this->getCurrentGroupId()) ? 'hide' : 'show' ?>
<li><a href="<?php echo $_group['home_url'];?>"><?php echo $this->htmlEscape($_group['name']);?></a></li>

<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.