user1324762
user1324762

Reputation: 805

Magento remove remember store language

I have Magento website with 3 store views and for each store view own language. A store view code is displayed in url and default store is english. www.example.com/ english www.example.com/en/ english www.example.com/de/ german www.example.com/fr/ france

The problem is that Magento will remember my language choice. If I click to German language (www.example.com/de/), the next time I will visit www.example.com language will be german as default because magento remembered it. This could be problematic because google will also get the same logic. And let's say if google crawled yesterday www.example.com/fr/, tomorrow will get displayed france language in www.example.com.

Is any simple way to avoid that?

Upvotes: 1

Views: 847

Answers (1)

Marius
Marius

Reputation: 15206

Option 1.
Edit index.php and instead of the last line:

Mage::run($mageRunCode, $mageRunType);

Put this:

Mage::run('en', 'store');//replace 'en' with the code of the English store view if it's different

This should always load the English store view if no store is specified.

If that doesn't work, there is....

Option 2
The code responsible for remembering the store is found in Mage_Core_Model_App::_checkCookieStore. This checks if there is a cookie with the last visited store view.
Since you cannot rewrite the Mage_Core_Model_App class, you can copy it in the local folder and make the method mentioned above always return $this, or you can remove the call to it from the _initCurrentStore method.

Upvotes: 2

Related Questions