Magento: StoreView URL redirect for multiple languages? - magento

In my store I have got 2 languages, English (default) and German. I also have a category, lets call it other.
The url key for other is other and sonstiges for the German view. Now, when I send somebody a link to the German view (www.example.com/sonstiges.html), it generates a 404 not found until I select German as language. Afterwards it works when the link is clicked.
I removed the store view code from my url by the way, it has to stay that way.
Why is that and how can I change it?
Thanks!

Its happening for url rewrite problem.
Example : For product if you provide different url key for different store view like different url key for English and different url key for German then if you share the url from english site and if someone open in German view then he will get 404 not found.
Solution : Go to that particular product in the admin then switch store view and set same url key for both store view. Either dont provide url key for any store view so Magento will generate by own.
Thanks .

Related

404 page when switching stores on magento product pages

i am trying to fix the following problem:
When i create a new product, i always give the english store a different url than the german store. On the frontend when i switch from the german store to the english store, it returns a 404 page. on the german product page the country id (de) is in the url (http://website/de/product1.html). But when i switch to the
english store the link looks like this: http://website/product1.html (without country id). And that gives me a 404 page!
Note: When i add the "en" country id to the url it works perfect.
can someone help me resolve this issue?
Magento Version 1.7.
Maybe try to change your english storeview base URL :
go to System -> Config then choose your english store view
then, in the config panel, go to general -> web
in "secure" -> Base URL uncheck "use website" and add en/ at the end of the URL.
do the same in in "unsecure"
I expect it will work.

Magento translation and url key

I have a Magento website with some pages linked to main navigation.
For example, in my default view (Italian) I have www.example.com/italian-url-key
Then I created another page for English view with url www.example.com/english-url-key
So, when I am on the italian version of the page and try to switch to english version, this is the url that magento generate: http://www.example.com/italian-url-key/?___store=english&store=&___from_store=default and on click it gives me 404 page.
How can I fix it? I need that this 2 pages should be linked, also if url key is different.
Many thanks!
Out of the box Magento does not support URL Translation, both pages need the same URL key. Check instructions from the Magento Docs on how to translate CMS pages.
To translate a CMS page, you must create a new page that has the same
URL Key as the original, but assigned to the specific store view.
So you will either have to stick to one languages for your URLs or develop/acquire a module to do this for you. The magento-language-roots or CMSRewrites modules both look like they will achieve this for you.
You may also want to consider adding Hreflang tags to your head.phtml as you have a multi-lingual site.

Magento shop language switch

I have a magento shop with 2 languages. The language switcher works with set a different store view in the url.
/shop/?___store=myshop_view for mainlanguage
/shop/?___store=myshop_view_fr for french
That works fine and how it should work.
Now first problem comes when I am in french store and switch to mainlanguage with /shop/?___store=myshop_view, now I see the shop in the mainlanguage, but when I call /shop/ without any storeview paramenters it switches back to french. Why is that and can I change that?
The second problem comes with externall add to card links. A add to card link would look like: /shop/checkout/cart/add/uenc/aHR0cDovL3d3dy5teS13aW5lLmNoLnJ1dGlzaGF1c2VyLm5pbmUuY2gv/product/2169/?___SID=U&___store=myshop_view
So this link is for the main language. If the shop was in french before and I click this link, i get the success message in the main language, but the rest of the shop is french again.
I think the first and second problem are nearly the same. Then the add to card link will redirect to the shop overview without any store view paramenter in the url.
Any idea how I can get a add to card link that can switch the language of the shop?
As #RohitS said. Magento saves the storeview in the cookie, and with the url you can change the storeview temporary, but the value in the cookie is still the same.
Good thing is, that the external add to card link is on a subdomain, so I was able to set the cookie for the hole domain (by adding a dot before the domain name: .domain.com). In the cookie I just had to set document.cookie = "store=myshop_view_fr;path=/;domain=.my-shop.com"; The path attribute was important for me, cause the shop is in /shop/.

Use Magento rest API with multi store view

I have a Magento website with 3 languages on 3 different store view. I need to retrieve product information through the rest API, accessing to this address:
http://-mysite-/api/rest/products
It works really fine, but I receive data only from the default store view. In my webapp I need to switch languages, and I need to access to the others store view. I read the documentation (http://www.magentocommerce.com/api/rest/introduction.html), but I cannot find anything about store view and multilingual sites... I tried passing language in the header or passing the store_id as "get variable"... nothing, it works only with the default store view. Any idea?
You can try this. magentomysite/api/rest/products/store/storeid . For example you can use as magentomysite/api/rest/products/store/1 for english store products.
Remember one thing. In the admin panel you have to give permissions to guest user also. Then only you can get the data through this url.
I hope this helps u.
To elaborate on Pavan's answer the following URL worked for me:
magentodomain.com/api/rest/products/:product_id/store/:store_id
You can find your store id with the following method explained in this answer:
How to find out what my store ID is?

Language Switching doesn't occur if url is entered in French having English store currently - in magento

I have difficulty that my current store is English & I am in category page but the thing is, that now if I write url's category.html part to it's french version then it gives an error of 404 page not found.
Ex. http://www.abcd.fr/r4-cards.html to http://www.abcd.fr/cartes-r4.html (From English to French View) - These are dummy urls so don't click to view!
Other thing is when I enter french url then the whole site should be converted in French view.
Any Help?
Please.
I suggest you to rebuild indexes . if everything is set up properly this is a cache and old indexes issue

Resources