Globalization and URLs


Does EPiServer Commerce support globalized content on the same URL?

For example, If I have two active languages in my catalog, en-GB and en-US with en-GB being the default language. Then for a given product, say "Audio Book", I set the SEO Urls like so

en-GB: audio-book.aspx

en-US: audio-book.aspx

If I switch to en-US in the EPiServer portion of the site and browse through the categories my Thread.CurrentThread.CurrentCulture, Thread.CurrentThread.CurrentUICulture and SiteContext.Current.LanguageName are all "en-US". Then, when I browse to the "Audio Book" product page, the three settings all change to "en-GB".

I've opened the EPiServer.Business.Commerce.HttpModules.dll in Reflector to have a look at how the URL re-writing is performed, and looking at the code in the GetProductByLink method, it appears to simply return the first product that has some SEO items, rather than matching on the current SiteContext.Current.LanguageName value.

I've added a few comments to the code below to clarify my thinking.

foreach (string str2 in GetAllCommerceLanguages())
    // Get the first catalog entry, passing in the language
    CatalogEntryDto catalogEntryByUriDto = CatalogContext.Current.GetCatalogEntryByUriDto(path, str2);

    // Assuming this is the first iteration, and that the item has some CatalogItemSeos
    // we proceed as if this is the correct item, there is no check if the language is the current working language.
    if (catalogEntryByUriDto.CatalogItemSeo.Count > 0)
        str = str2;
        CacheManager.RuntimeCacheInsert("EPiServer::CommerceProductLink::" + path, new object[] { catalogEntryByUriDto, str2 }, null, Cache.NoAbsoluteExpiration, new TimeSpan(0, 0, 15));
        Dictionary<string, CatalogEntryDto> dictionary2 = new Dictionary<string, CatalogEntryDto>();
        dictionary2.Add(str, catalogEntryByUriDto);

        // The item is processed and returned as correct
        return dictionary2;


Jun 14, 2011 10:29

Thank you for the information! It does indeed look lika bug, will investigate and update here ASAP.


Jun 16, 2011 5:49

Sorry for the extremey long delay. The sad truth is that due to some mismatch in language handling between ECF and EPiServer CMS this turned out to be very difficult to fix properly in the CMS 6 / ECF 5.2 codebase. We are planning to address this with the next major release of EPiServer Commerce that will run on top of EPiServer CMS 7 (a k a Falcon).

Jun 14, 2012 10:12
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.