![]() ![]() Note: The same GetUserGeoIP method is used in API which gets the correct countryName. But, today when i tracking online the status become 'NULL'. Var countryItem = ISO3166.FromAlpha2(countr圜ode) īut I am getting an below exception 7904 10:43:25 ERROR Cannot create tracker.Įxception: System.InvalidOperationExceptionĪt .GetSession()Īt .EnsureContext.Process(InitializeTrackerArgs args)Īt (PipelineArgs args)Īt ()Īt .GetTracker.Process(CreateTrackerArgs args)Īt () China post status 'NULL' problem I shipped something to my country by Chinapost. Log.Error("GetUserGeoIP Error: " + ex.Message + " Source: " + ex.Source + " Stack Trace :" + ex.StackTrace + " Inner Ex : " + ex.InnerException, ex) ("/" + (String.IsNullOrEmpty(langCode) ? : langCode) + rawPath) īelow is the GetUserGeoIP function public static string GetUserGeoIP()Ĭountr圜ode =. Once you find it’s stuck at a station for over 30 days, it may be lost. It will be moved again after the backlog problem is solved. It may be delayed due to the pile-up of goods. LangCode = availableLangs.FirstOrDefault().ToString() If you find your package is stuck in China at a transit station or someplace for a week, just wait for more days to see. If (availableLangs != null & availableLangs.Count > 0 & !availableLangs.Contains(())) List availableLangs = LanguagesWithContent(Context.Item) Language = LanguageManager.GetLanguage() sometimes the language found is slightly different than official language item used in SC ID langID = LanguageManager.GetLanguageItemId(language, ) then try to get the language item id from the language or two letter iso code If (Language.TryParse(langCode, out language)) If (country.Trim().ToUpper() = "China".ToUpper())Įlse if (country.Trim().ToUpper() = "Japan".ToUpper())Įlse if (country.Trim().ToUpper() = "Thailand".ToUpper()) Some other less common formats may also exist. String country = GeoIPUtils.GetUserGeoIP() The most common tracking number format is a combination of 13 alphabetic and numeric characters, usually starting with 2 alphabets, following by 9 digits, and ending by 'CN' (e.g. If(!string.IsNullOrEmpty(GeoIPUtils.GetUserGeoIP())) If (!rawPath.StartsWith("/sitecore") & !rawPath.StartsWith("/" + + "/") & !rawPath.StartsWith("/" + ) & !rawPath.StartsWith("/default.aspx")) We can use this to add the language back into the path. contains path including language and query string ![]() || Context.Database = null || = "shell" || !this._sites.Contains()) ![]() public void Process(HttpRequestArgs args) I am checking using the sitecore tracker in pipeline process to get the country code using the below method. For example when user trying to access from china my site should as. I need to redirect based on the country location the user is trying to access. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |