Moving the Magento Store Switcher / Selector

Anyone who has dabbled in making multiple stores in Magento has eventually wanted to change the way the Magento store switcher (also referred to as the Magento store selector) works. By default Magento provides a store switcher in the form of a select menu. The store switcher is located in the footer of the site by default. This post will cover how to move the store switcher (store selector) from the footer to the header.

Moving the Magento Store Switcher to the Header

First off, you will want to locate your “page.xml” file. This is located in the ‘app/design/frontend/base/default/layout’ directory. (Note: If you are using your own template your path may be different.) Open it with your favorite text editor and find the line of code below.

<block type="page/switch" name="store_switcher" as="store_switcher" template="page/switch/stores.phtml"/>

This line is located in the “page/html_footer” block. Cut the line and paste it just under the “page/html_header” block as shown below.

<block type="page/html_header" name="header" as="header">
<!--Added Store Switcher-->
<block type="page/switch" name="store_switcher" as="store_switcher" template="page/switch/stores.phtml"/>

Moving this will allow you to access the store switcher from the header. Now find your header.phtml file and open it with your favorite editor. This is located in the ‘app/design/frontend/base/default/template/page/html’ directory. (Note: If you are using your own template your path may be different.). From there you will want to add this PHP code. Add it wherever you would like that suits your design.

<?php echo $this->getChildHtml('store_switcher') ?>

Congratulations! You have successfully moved the Magento store switcher from the footer to the header. As with any changes – be sure to clear your cache.