Developer forum

Forum » Development » Custom eCommerce language url provider

Custom eCommerce language url provider

Mikkel Toustrup Olsen
Reply

Hello all,

I'm facing an issue where I want to translate my friendly url based on the language layer. As I'm integrating products via AX the product name, which is repesented in the URL, is only on Danish as all the products name are imported in this. I do have some logic that can translate the product names to its respective language name, however I cannot implement this functionality to my Custom URL Provider. Is there a way to control the url provider pr language? . And is the URL provider only being called 1 time?

I've noted that the Mapping constructor can take 3 and 4 parameters - however the 4th isnt "implemented yet". I'm working on a 8.5.1.9 :-)

 


Replies

 
Nicolai Høeg Pedersen
Reply

Hi Mikkel

The URLs for ecommerce is dependent on Ecommerce languages - so you can have one URL per ecom language. Each ecommerce language can be added to a website/language using the ecommerce settings on website properties and that context will be used to resolve the URLs.

So create the ecom languages in admin, create a URL provider that uses LANGID as the 3rd parameter when building the URL index, and you should be home free.

 
Christian Fisker
Reply

Hi Nicolai,

I'm working with Mikkel on the same project and the challenge is that there is only one EcomCatalog and one EcomLanguage. Translated product names are in a custom table. 
Is it possible that you could make it possible for us to create a 'UrlAlternateKeyProvider', which would return something else than the Context.LanguageID which is hardcoded today?

Regards,
 Christian

 

 
Nicolai Høeg Pedersen
Reply

Hi Christian

We could, but kind of a corner case. And what you do is duplicate content on purpose...

There are tons of other issues if you do not use Ecommerce languages - what happens when an english product is added to the cart, then it will have Danish names there? What about related products, names in searches and so many other things would f'''ck up if you do it half heartet.

It sounds like you are making something that will haunt you.... :-)

BR Nicolai

 
Christian Fisker
Reply

Hi Nicolai,

It is basically a heavily customized solution that has been running since 2011 which is now being upgraded. Product name etc in catalog and cart work just fine. The final piece of the puzzle seems to be translation of friendly url's :-)

Regards,
 Christian

 

 
Mikkel Toustrup Olsen
Reply

Hi Nicolai,

In that case would the "optimal" approach in this situation be to export the products to their respective languages instead?

 
Nicolai Høeg Pedersen
Reply

Yes!

 

You must be logged in to post in the forum