Commercer 13 UrlResolver path not returning full path


Commerce 13.30.0

Both using urlresolver and the UI, the path to SOME variations and products are shortend (not all, not all under the same node) - Should be -

Any idea where to start searching?

Apr 21, 2022 21:51

seems to be context related
since the url works in one  site

and not in other site
Is there a way to use UrlResolver by SiteID? for example in scheduled job?
Apr 22, 2022 13:05

Could you access the short url? If yes, does your product/variant have multiple categories associated? 

Apr 25, 2022 12:05

Hi Quan! Yes i does have multiple categories associated.

Im validateing doing this in the scheduled job,,, hope it is not any overhead

                SiteDefinition currentSiteDefinition = SiteDefinition.Current;
                SiteDefinition.Current = siteDefinitionWithRightContext;
                url = new Uri(_urlResolver.GetUrl(contentReference, ContentLanguage.PreferredCulture?.Name, new UrlResolverArguments { ForceAbsolute = true }))?.PathAndQuery ?? string.Empty;

                SiteDefinition.Current = currentSiteDefinition;
Apr 25, 2022 12:11
* 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.