Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more

Routing does not work for commerce entities (Commerce 8.2.0 and CMS 7.15)

Vote:
 

Hi,

I am using the default routing according to this documentation: http://world.episerver.com/documentation/Items/Developers-Guide/EPiServer-Commerce/8/Routing/Routing/

CatalogRouteHelper.MapDefaultHierarchialRouter(routes, true);

But I am having trouble getting it to work at all.

I have the following controller:

    public class NodeContentController : ContentController{
		public ViewResult Index(NodeContentBase currentContent, ContentBase currentPage) {
            return View();
	    }
    }

I also have a catalog called "Products" with the "Name in URL" called "products".

When I try to request the products page I request the following URL: http://myshop.local/da/products/    that is also the url the backend refers to when clicking "View on website".

But it does not get to the controller. I just get the default "HTTP Error 404.0 - Not Found" with the "StaticFileHandler", just like any other random url that does not exist.

The routing for content pages works perfectly.

Does anyone have a clue what could be the problem here?

Thanks
Rasmus

#114994
Jan 07, 2015 15:22
Vote:
 

Sorry, I'm NOT using:

CatalogRouteHelper.MapDefaultHierarchialRouter(routes, true);

I'm using false instead, to make hierarchical URL's:

CatalogRouteHelper.MapDefaultHierarchialRouter(routes, false);
#114995
Jan 07, 2015 15:24
Vote:
 

Hi,

If you're using CatalogRouteHelper.MapDefaultHierarchialRouter and your catalog is named "Products" then the url http://myshop.local/da/products/  should point to page with renderer of CatalogContent. I assume you're missing that page type, hence the 404 error. Can you try to add it to see if it works?

Regards.

/Q

#115019
Jan 08, 2015 8:32
Vote:
 

Hi,

Thanks - Apparently it works if I make a controller that uses the CatalogContent instead of NodeContentBase.

But my colleague has a similar project that works with the NodeContentBase, so I'm a little confused why it does not work that way in my project.

Best regards

Rasmus

#115070
Jan 08, 2015 20:48
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.