Knowledgebase: Magento
Magento - Clean URL for Languge Store Switcher
Posted by Viktor KLYMONCHUK on 15 January 2012 06:06 PM

Open file:

/app/design/frontend/default/<your_theme>/template/page/switch/languages.phtml

Find

<option value="<?php echo $_lang->getCurrentUrl(false) ?>"<?php echo $_selected ?>><?php echo $this->htmlEscape($_lang->getName()) ?></option>

Make sure that there is false in the getCurrentUrl(false).

Step2 :

In Admin, go to System > Configuration > Web / URL Options > Add Store Code to Urls 

Check it to 'Yes'.

Step 2: Refresh Cache 

Should work now.

 

Note:

Your design might not have the switch/languages.phtml file; just copy it from from 

/app/design/frontend/base/default/template/page/switch/languages.phtml

to

/app/design/frontend/default/<your_theme>/template/page/switch/languages.phtml


(2 vote(s))
Helpful
Not helpful

Comments (4)
Hemanth
12 January 2013 07:53 PM
Hi... I have weird situation... If i put FALSE in the call then I will get the language code in url when switching. But then url rewrite between different product url per store view does not work.

When I put TRUE then url rewrite works but then it is lost the store view code in url (yes in both option is enabled to add store code to url).

How to solve it?
Viktor
13 January 2013 04:18 PM
If i put FALSE in the call then I will get the language code in url when switching. But then url rewrite between different product url per store view does not work
================
Try to re-index the shop; namely the catalog_url
http://goo.gl/8sOik
Viktor
13 January 2013 04:18 PM
If i put FALSE in the call then I will get the language code in url when switching. But then url rewrite between different product url per store view does not work
================
Try to re-index the shop; namely the catalog_url
http://goo.gl/8sOik
luis miguel
24 January 2013 05:57 PM
any solution?
I have the same problem!!!
Support by WebCTO.eu