Developer forum

Forum » Ecommerce - Standard features » Change language and stay on same product page

Change language and stay on same product page

Martin Grønbekk Moen
Martin Grønbekk Moen
Reply

Related to this question, but in a product page context.
https://doc.dynamicweb.com/forum/cms-standard-features/cms-standard-features/changing-language-in-fronend

If you open a product page in english, and wish to change the language, you are then redirected to the product list or sometimes the frontpage.
Is it possible to make sure the user is still on the same product page, but just in a different language?

My first guess is that it would be hard, since you dont know if the product is available in the language you switch to.
Any thoughts around this? I can see that it is not working on your demo site http://rapidodemo.dynamicweb-cms.com/products/bikes/mountain-bikes/mongoose-tyax-comp-disc-3 if you change language here, you are redirected to the front page.


Replies

 
Nicolai Pedersen
Reply

Given you have a products page with ID 123 in the Danish website - and the corresponding page in the english website is id 456 - and each of the 2 pages are on websites with different ecommerce languages, you can make the switch like this

Danish version = Default.aspx?ID=123&GroupID=GROUP1&ProductID=Prod1
English version = Default.aspx?ID=456&GroupID=GROUP1&ProductID=Prod1

The context language on the 2 urls are different, and the right language would be found.

An alternative if you have only one website is this

Danish version = Default.aspx?ID=123&GroupID=GROUP1&ProductID=Prod1
English version = Default.aspx?ID=123&GroupID=GROUP1&ProductID=Prod1&Language=Lang2

BR Nicolai

 

You must be logged in to post in the forum