Site root shortcut settings destroys commerce routing



I have just discovered that if you set a shortcut of the startpage of the cms site, commerce product detail pages do no longer work. It looks like a routing issue where it tries to route to the target of the shortcut instead of the actual product. I have observed this by enabling debug logs in EPiServer. Viewing the products in EPiServers edit mode still works, for both forms and on-page editing.



  Site (Start page - the site root - shortcut to SubPage)


The above prevents product detail pages from being shown.

I would say this is a bug, but can anybody think of a workaround to this so I can get it to work?

Jun 22, 2015 12:16

MapDefaultHierarchialRouter need a root page to work, which is registered by CatalogRouteHelper. By default, the "root" page of CatalogRootHelper is the start page. So if you set up the short cut to SubPage, you have to speficify new root page - i.e., you need to change from this:

CatalogRouteHelper.MapDefaultHierarchialRouter(RouteTable.Routes, false);

to this:

CatalogRouteHelper.MapDefaultHierarchialRouter(RouteTable.Routes, () => new ContentReference(7), false); //ContentLink of subpage.

I would say this is not a bug, but as design.



Jun 22, 2015 16:00

Hi Quan,

I am not sure I agree with that, it already got a root page, namely the startpage in my case. That the startpage redirects to another page shouldn't affect the commerce routing. This basically has the effect that normal editors who use the standard functionality in EPiServer can change how the routing works(and break it if they remove the shortcut) for the commerce part, very bad imho. Also this affects the url of the products, so it will become http://somesite/page-that-was-shortcut-to/catalogname/category/product.

it was accepted yesterday as a bug by support.

Jun 23, 2015 10:05
* 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.