Home » » Blog / News » Web Programming » 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.
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.
RSS feed for comments on this post. TrackBack URL


Nice post Jeremy! Magento is so powerful, but sometimes a little hefty to dive into. Thanks for making this simple!
Comment by zach — May 6, 2010 @ 1:30 pm
[...] our last post we discussed how to move the Magento Store Switcher/Selector from the footer to the header. Now [...]
Pingback by Changing the Look of the Magento Store Switcher/Selector | DNA Web Agency — May 24, 2010 @ 10:02 am
Thanks.
It helped me great deal.
Comment by Sajid Iqbal — January 7, 2011 @ 12:16 pm
[...] our last post we discussed how to move the Magento Store Switcher/Selector from the footer to the header. Now [...]
Pingback by Changing the Look of the Magento Store Switcher/Selector — August 24, 2011 @ 1:52 am