Hi there,
We have a site where every now and then the order is not passed to a configured checkout handler but is instead handled by the DefaultCheckoutHandler. After some triubleshooting we found that these orders had LANG1 as their language (which is Danish) even though the entire website should only run on LANG2 (US). We can't delete LANG1 yet as there's an old import that assumes that as the defautl language.
We did some further digging and eventually found the following in eCommerce.Common.Context im the LanguageID property:
' Language id was not found in Items, Cookie or Session -- falling back to default language
If String.IsNullOrEmpty(langId) Then
Dim defaultLanguage As Language = Application.DefaultLanguage
If defaultLanguage IsNot Nothing Then
langId = defaultLanguage.LanguageID
Else
' This should never happen as there must always be a default language.
Throw New InvalidOperationException("Default language does not exist.")
End If
End If
Application.DefaultLanguage gets the ID of the language that is set as the default.
It seems in our case that for some reason the customer loses its langage setting (cookie, expired session, etc). Apparently that can happen as the code in Context.LanguageID tries to find it elsewhere if it can't find it in a session variable or cookie.
My question now is: should LanguageID also look in the configured web site instead of directly in the application's default languuage? If we can't find a language on the current user, the next fallback should be the configuration on the area/site and not the global languages collection, right?
Let me know if you need me to provide more information on any of the above.
Thanks,
Imar