PHP Magento Tips

How to Set Default Store Language and Clean URL for Languge Store Switcher in Magento

Rate this posting:
{[['']]}

If you want to set some default language for your Magento store then follow below step:

open .htaccess file and write below code at the end of the file.

SetEnv MAGE_RUN_CODE german

This will set Default Language as german for your store.

To Clean URL for Languge Store Switcher follow below step:

Copy File From

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

and paste into

app/design/frontend/rwd(or your theme)/default/template/page/switch/languages.phtml

And Modified below code:

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

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

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

Check it to 'Yes'.

Refresh Cache

Should work now.
Tag : Magento
0 Comments On "How to Set Default Store Language and Clean URL for Languge Store Switcher in Magento"

Back To Top