Join us this Friday for AI in Action at the Virtual Happy Hour! This free virtual event is open to all—enroll now on Academy and don’t miss out.

 

Commercer 13 UrlResolver path not returning full path

Vote:
 

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)
domain.no/he-jacket-bb898cc5/black/ - Should be - domain.no/dame/jakker/the-jacket-bb898cc5/black/



Any idea where to start searching?

#278946
Apr 21, 2022 21:51
Vote:
 
UPDATE

seems to be context related
since the url works in one  site
http://site1.domain.no/EPiServer/Commerce/Catalog#context=epi.cms.contentdata:///532072__CatalogContent&viewsetting=viewlanguage:///no

and not in other site
http://site2.domain.no/EPiServer/Commerce/Catalog#context=epi.cms.contentdata:///532072__CatalogContent&viewsetting=viewlanguage:///no
Is there a way to use UrlResolver by SiteID? for example in scheduled job?
#279002
Apr 22, 2022 13:05
Vote:
 

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

#279154
Apr 25, 2022 12:05
Vote:
 

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;
#279156
Apr 25, 2022 12:11
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.