AI OnAI Off
Hi Andreas,
You need to register the partial router for the catalog, like metioned in docs (although a bit outdated):
using EPiServer.Commerce.Initialization;
using EPiServer.Commerce.Routing;
using EPiServer.Framework;
using EPiServer.Framework.Initialization;
namespace Your.Project.Namespace;
[ModuleDependency(typeof(InitializationModule))]
public class RegisterRoutingModule : IInitializableModule
{
public void Initialize(InitializationEngine context)
{
CatalogRouteHelper.MapDefaultHierarchialRouter(false);
}
public void Uninitialize(InitializationEngine context)
{
}
}
I have upgraded Optimizely 11 -> 12 and Commerce 13 -> 14.
I now have trouble getting the routes to work.
/[catalog]/[category]/[product] simply does not work. It returns a 404 page.
Previewing in /episerver/commerce works fine.
Routing for Optimizely works fine.
I have:
- services.AddCommerce()
- endpoints.MapContent()
Added web site to catalog.
The documentation seems outdeted?
https://docs.developers.optimizely.com/commerce-connect/docs/routing
Do I need to do anything to make the routing work?
And maybe be able to explain what I do.
But, generally:
- services.AddCommerce()
- endpoints.MapContent()
Should be enough to register Commerce catalog routing?
The linked documentation, is that for previous (.NET Framework) versions?
Or is there a "register routes" step I might be missing?