Multiple store views - Language switch issue

Please LogIn to Reply!

Post By: admin | 26-01-2012 06:35 Reply

 

Hello,

I have setup a multi lingual site using magento version 1.3.2.4 and have come accross some weird problems. Hoping that I could get some assistance.

The requirement was to add the new store view (dutch) and also maintain the current stores url structure, so I couldnt use ‘Add store codes to urls’ in the admin configuration as it would append the current urls with the default store code (fr). So, ultimately I needed the following url structures:

Default language (fr) url style : http://www.domainname.com
Dutch version url style : http://www.domainname.com/nl

For this I performed the the following steps:

1. I created a store view (code nl)
2. I created a folder by the name of nl

- I copied the .htaccess and index.php from the main web root and pasted it in this folder
- I modified the code as follows in index.php :

Mage::app()->getLocale()->setLocale('nl_NL');
$mageRunCode 'Netherlands';
$mageRunType 'store';
Mage::app()->setCurrentStore(1); // 1 being the nl store id
Mage::run($mageRunCode$mageRunType);

When I launch the site, and goto http://www.domainname.com/nl the interface is in dutch as expected, but when I perform the following tasks I get redirected back to the default language:

1. Login
2. Goto checkout/cart
3. Goto new user signup

Upon checking the view-source of the DOM I notice that some urls are pointing to the default language and not the nl language. For example the login form’s action attribute is http://www.domain.com/customer/account/loginPost/ and not http://www.domain.com/nl/customer/account/loginPost/

Update : I was able to get the Goto checkout/cart to work . Also I noticed that the customer.xml and checkout.xml use different functions to generate the /customer/account link, Could the problem lye there?

Also could I ask if its possible to modify customer/getAccountUrl to set the language?

Warm regards,

 

Hello
Go to system->configuration->Web, switch to the ‘NL’ store view from the top right select.
and change the ‘Base url’ in unsecure section to ‘http://www.domainname.com/nl/’. If you use secure urls to the same for the ‘secure’ section.
If the Base Link URL is http://www.domainname.com/ change it also to http://www.domainname.com/nl/ (both sections).
For the secure section replace http with https if you have a SSL certificate installed.

Bonus:
You don’t need this line in the nl/index.php file : Mage::app()->getLocale()->setLocale(’nl_NL’);
Just change it from system->configuration->General->Locale->Locale, just for the NL store view.

Clear the cache and try again.

Marius.

 Signature 

http://marius-strajeru.blogspot.com/

 

Hi,

Thanks for your response, but I have already setup the Base URL and Base Link URL as you have mentioned with no luck.

What else could be the issue?

Regards,

 

Clear the cache.

 Signature 

http://marius-strajeru.blogspot.com/

 

And something else:
in index.php where you have this line:

$mageRunCode 'Netherlands';
You should put the code of the store view.

 Signature 

http://marius-strajeru.blogspot.com/

 

Hi,

Ive cleared the cache and also set $mageRunCode = ‘nl’; (the store code) but its still not working

Warm regards,

 

I was able to get the “Goto checkout/cart” part to work . Also I noticed that the customer.xml and checkout.xml use different functions to generate the /customer/account link, Could the problem lye there?

Also could I ask if it’s possible to modify customer/getAccountUrl to set the language?

Regards,

 

I have been annoyed by this problem for a long time,so thank you for your post, it is really useful for me.
__________________________________
share love,share happy,share useful information about http://www.mmohome.com/gold/Guild-Wars-2-US.html/ and http://www.mmolive.com/

`Reply Or Comment!
Please LogIn to Reply!