Try the Demo

Magento Forum

   
How do I avoid these long links (from store) when I switch Store Views? Example: /sp/?___from_store=default ?? 
 
otzstzzn
Mentor
 
Total Posts:  1071
Joined:  2009-07-13
 

Hi,

How do I avoid these long links when I switch Store Views?

Example 1: (this is ok )

www,mydomain.com/default/

Example 2 -16:

www,mydomain.com/sp/?___from_store=default

or

www,mydomain.com/fr/?___from_store=sp

How can i avoid this here > ?___from_store=

or this

com/fr/?___from_store=sp

Thank you very much !

Image Attachments
Bild 146.pngBild 147.pngBild 148.pngBild 149.pngBild 150.pngBild 151.pngBild 152.pngBild 153.pngBild 154.pngBild 155.pngBild 156.pngBild 157.pngBild 158.pngBild 159.pngBild 160.pngBild 161.png
 Signature 

Never touch a running system !

Magento 1.5.1.0. BLANK THEME | Mac OSX 10.68 | Safari 5.05 | Firefox 5.0

 
Magento Community Magento Community
Magento Community
Magento Community
 
Appmerce
Guru
 
Avatar
Total Posts:  373
Joined:  2008-05-13
Amsterdam, The Netherlands
 

If you use different subdomains, you should add a switch in index.php to load correct store views.

Make a store view per language.

Then remove the standard language switch (in header.phtml), and create your own to jump to subdomains without adding ?__from_store

 Signature 

- (English) Morningtime Extensions is now Appmerce - Applications for Ecommerce
- (Nederlands) Morningtime Extensies heet voortaan Appmerce - Applicaties voor ecommerce

 
Magento Community Magento Community
Magento Community
Magento Community
 
otzstzzn
Mentor
 
Total Posts:  1071
Joined:  2009-07-13
 

Hi Morningtime,

thank you very much !

 Signature 

Never touch a running system !

Magento 1.5.1.0. BLANK THEME | Mac OSX 10.68 | Safari 5.05 | Firefox 5.0

 
Magento Community Magento Community
Magento Community
Magento Community
 
DerAndrej
Jr. Member
 
Total Posts:  3
Joined:  2010-05-12
 

There is a much easier way to achieve this. I write this for Magento 1.4x, but with a little modification it is achievable for every older Magento version.

If you look into /app/code/core/Mage/Core/Model/Store.php you see following function:

public function getCurrentUrl($fromStore true)

So without changing any core code grab /app/design/frontend/base/default/template/page/switch/languages.phtml

Change the line

<option value="<?php echo $_lang->getCurrentUrl() ?>"<?php echo $_selected ?>><?php echo $this->htmlEscape($_lang->getName()) ?></option>
to
<option value="<?php echo $_lang->getCurrentUrl(false) ?>"<?php echo $_selected ?>><?php echo $this->htmlEscape($_lang->getName()) ?></option>
and put the changed file into the corresponding path of your theme folder.

And now you have clean URLs.

 
Magento Community Magento Community
Magento Community
Magento Community
 
otzstzzn
Mentor
 
Total Posts:  1071
Joined:  2009-07-13
 

Hi DerAndrej,

thank you very much !!!!!

Great news ....

 Signature 

Never touch a running system !

Magento 1.5.1.0. BLANK THEME | Mac OSX 10.68 | Safari 5.05 | Firefox 5.0

 
Magento Community Magento Community
Magento Community
Magento Community
 
DerAndrej
Jr. Member
 
Total Posts:  3
Joined:  2010-05-12
 

There is another real bug with language switch which occurs if you use localized category and/or product urls, I reported this issue: http://www.magentocommerce.com/bug-tracking/issue?issue=9154

 
Magento Community Magento Community
Magento Community
Magento Community
 
ex-xtc
Member
 
Total Posts:  43
Joined:  2007-10-16
 

this helped. but now it looks like:

http://www.mystore.de/?___store=de

 
Magento Community Magento Community
Magento Community
Magento Community
 
kwoolf
Jr. Member
 
Total Posts:  18
Joined:  2009-02-10
 

Yeah, I’ve searched high and low for a way to remove the `?___from_store=` parameter from SEF URLs. Is there anyone out there that can shed some light on this for me? Could the URL Rewrite be used? New install of Magento v1.4.1.1.

Kev

 
Magento Community Magento Community
Magento Community
Magento Community
 
outre99
Jr. Member
 
Total Posts:  16
Joined:  2009-06-28
 
DerAndrej - 14 May 2010 03:54 AM

There is another real bug with language switch which occurs if you use localized category and/or product urls, I reported this issue: http://www.magentocommerce.com/bug-tracking/issue?issue=9154

Ran into the same issue.  If using language (store view) specific url keys changing language via the switcher only changes the store view code but not the url-key, which results in 404.  This is a huge oversight as it invalidates the whole point of using different url keys for different languages.

The only workarounds i can think of is either create custom URL rewrite rules to force the proper url key or to automatically open the home page when the language is changed.  The first option can be time intensive if the number of categories is significant.  The second one makes sense since users don’t jump back and forth between the languages very often, but it feels like a half-baked solution somehow.

 
Magento Community Magento Community
Magento Community
Magento Community
 
rivus
Jr. Member
 
Total Posts:  10
Joined:  2010-08-10
 

Waah, I have the same damn problem and it is really annoying me like hell, especially my customer who runs the show. I tried DerAndrejs solution, but it just works partially (thanks anyways, dude!).

I hope there’s gonne be a solution!

 
Magento Community Magento Community
Magento Community
Magento Community
 
simup
Jr. Member
 
Total Posts:  8
Joined:  2012-01-12
 
DerAndrej - 12 May 2010 06:47 AM

There is a much easier way to achieve this. I write this for Magento 1.4x, but with a little modification it is achievable for every older Magento version.

If you look into /app/code/core/Mage/Core/Model/Store.php you see following function:

public function getCurrentUrl($fromStore true)

So without changing any core code grab /app/design/frontend/base/default/template/page/switch/languages.phtml

Change the line
<option value="<?php echo $_lang->getCurrentUrl() ?>"<?php echo $_selected ?>><?php echo $this->htmlEscape($_lang->getName()) ?></option>
to
<option value="<?php echo $_lang->getCurrentUrl(false) ?>"<?php echo $_selected ?>><?php echo $this->htmlEscape($_lang->getName()) ?></option>
and put the changed file into the corresponding path of your theme folder.

And now you have clean URLs.

Thanks, Worked for me !

 Signature 

Cheap mobile internet abroad ! http://www.simup.nl

 
Magento Community Magento Community
Magento Community
Magento Community
 
zavodyanka
Jr. Member
 
Total Posts:  1
Joined:  2012-02-27
 

Enable “Add Store Code to Urls” to remove “?___store=de”

Image Attachments
screen_020.png
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top