Developer forum

Forum » Ecommerce - Standard features » Why raw url is changed to FriendlyUrl and are product displayed in the wrong language

Why raw url is changed to FriendlyUrl and are product displayed in the wrong language

Sander Veltman
Reply

In de shop we use a site navigation menu.

In this menu the user can navigate to a group overview page.

In the template we use a raw url but in some way this url is at client site converted to an user friendly url. I can't figure out why this happens.

The raw url links to the correct groupId and pageId in Dutch, but the converted user friendly url links to a wrong ecom navigation in English.

The navigation with id's for dutch in dw is: Producten 6455 -> Groep overzicht 6476 -> Categorie overzicht 6479 -> Subcategorie overzicht 6478

The navigation with id's for english in dw is: Products 6490 -> Group overview 6511 -> Category overview 6514 -> Sub category overview 6513

The raw url -> /Default.aspx?ID=6478&GroupID=GROUP14170

This should be the friendly url -> https://bike-motion-benelux.jaarbeurs.dev/nl-nl/producten/subcategorie/inrichting/kasten-schappenrekken/schappenrekken-8

But the user sees -> The user friendly url -> /nl-nl/producten/subcategorie/decoration/cabinets-and-storage-racks/storage-racks-6

 

Hereby some additional information.

The URL of de shop is: https://bike-motion-benelux.jaarbeurs.dev/nl-nl/producten/subcategorie/services/parking/parking-1

nl-nl: It seems that the language is correct set to dutch
/producten/subcategorie: Are Dutch templates so this is correct
/services/parking/parking-1: Is the English shop so this is not correct

All the content is displayed in Dutch, but the products are displayed in English.

 

 

 

Language_problem.png

Replies

 
Nicolai Pedersen
Reply

The URLs are converted because of a setting in the Management Center, see dump#1.

The Ecommerce URL part is handled by the context language when translated into the url. Set the right ecommerce language on this website, see dump#2

Capture.PNG Capture1.PNG
 
Sander Veltman
Reply

Hi Nicolai,

Thank you for your reply.

I checked some configurations in Dynamic Web.

The internal links setting in the Management Center is set to true -> see dump#1

And the ecommerce language setting is also set to the correct language -> see dump#2

Unfortunately this seems correct.

Do you have something else in mind?

Regards Sander

Dump_1.png Dump_2.png
 
Nicolai Pedersen
Reply

Yes, when you set it to true DW will replace the raw url with the friendly link. If you do not want that behavior, remove the checkbox.

Since your products are also in english text on the page, I am sure you have set the wrong context language. Try opening the URL in another browser in private mode so you do not get your backend login settings messed up with the frontend. Also if you see the frontend as a user, that user can have another country/language set on the user in the user management.

Be sure to upgrade the solution - we did fix an issue with backend context language coliding with the frontend context language

 
Sander Veltman
Reply

Hi Nicolai,

I tested the shop with mozilla in private mode.

When I browse to the product in Dutch it is indeed displayed in Dutch.

When I switch between languages, products and productgroups the behaviour seems correct.

At this moment we are using DW version 8.8.0.2 and will update it to the latest version.

The out come I will report here on this forum

Regards Sander

 
Sander Veltman
Reply

Hi Nicolai,

Yesterday I installed the latest Dynamic Web core (Enterprise 2014 version 8.8.1.17) for our shop. -> see dump#3

Unfortunately the problems are not solved.

If I navigate to the Dutch product, the shop generates a wrong url. -> See dump#4

The generated url -> https://bike-motion-benelux.jaarbeurs.dev/nl-nl/producten/subcategorie/set-of-5-car-parking-exit-tickets-11/set

nl-nl/producten/subcategorie -> Dutch templates

set-of-5-car-parking-exit-tickets-11/set -> English Ecom

Yesterday you spoke about a language setting of the frontend as a user in the user management.

Can you tell me where to set this setting?

Regards Sander

 

 

 

Dump_3.png Dump_4.png
 
Nicolai Pedersen
Reply

Hi Sander

It is me getting confused. You can set currency and delivery country on the user - not the language.

The URLs are based on the language context the user is currently in - if the user is in no context, the website context is used. It works like this because some websites can switch ecommerce language on the same website.

Are you able to browse the website with correct URLs when not logged in? I would need to see your entire setup in order to find out what is the misconfiguration.

BR Nicolai

 
Sander Veltman
Reply

Hi Nicolai,

Unfortunately we also have the language problem even if we are not logged in to the admin.
I will explain the problem from an other perspect of view.

The user browses the shop in de Dutch language context (lang1) and we use the following code to build up the navigation header menu to display the groups:

var path = "Default.aspx?ID=6476&GroupID=GROUP14076";
SearchEngineFriendlyURLs.GetFriendlyUrl(path);

The result of the method is: /nl-nl/producten/groep/technical-connections-8

The correct part is:
/nl-nl/producten/groep/ this corresponds with the Dutch language page ID (6476)

The wrong part is:
technical-connections-8 this corresponds with -> GROUP14076

This is the correct group but not the correct language.
We expect the group name in Dutch (Lang1) which is: Techniek

Why does the method return the correct group in the wrong language?

Regards Sander

 

 

 
Nicolai Pedersen
Reply
This post has been marked as an answer

Hi Sander

Basically you should never ever call SearchEngineFriendlyURLs.GetFriendlyUrl(path);. Dynamicweb has to take care of handling the URLs - it knows the things much better.

Problem here is the order of how things happen. If you build your navigation in custom code (it sounds like it), it probably executes before the shop context is handled.

So if you just render the regular format to the browser, Default.aspx?ID=6476&GroupID=GROUP14076, Dynamicweb will handle the rest. It is much safer than doing it your self.

If you somehow need to call GetFriendlyUrl anyways, you have to make sure that the Ecommce.Context.LanguageID is the right one before calling GetFriendlyUrl.

BR Nicolai

Votes for this answer: 1

 

You must be logged in to post in the forum