Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
HierarchicalCatalogPartialRouter
includes the name of the catalog in the route, so I'd say this functionality is there out of the box. Example:
/catalog1/categoryA
/catalog2/categoryB
Hi Juan,
Please try the below code hope it will work in your case.
The HierarchicalCatalogPartialRouter
class constructor takes two parameters one is the route starting point and another commerce root (catalog root). In commerce root, we can try to pass the second catalog root and then check it's work or not.
CatalogContent secondCatalog = contentLoader.GetChildren<CatalogContent>(rootLink).Skip(1).FirstOrDefault();
Func<ContentReference> startLink = () =>
ContentReference.IsNullOrEmpty(SiteDefinition.Current.StartPage)
? SiteDefinition.Current.RootPage
: SiteDefinition.Current.StartPage;
RouteTable.Routes.RegisterPartialRouter(new HierarchicalCatalogPartialRouter(startLink, secondCatalog, false));
Hi
If I have 2 catalog under Root,
is it possible to tell Commerce in HierarchicalCatalogPartialRouter to choose witch Catalog to take from?