Skip to content

Commit d74df64

Browse files
authored
Update 10/umbraco-cms/reference/routing/custom-routes.md
1 parent eca8ac7 commit d74df64

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

10/umbraco-cms/reference/routing/custom-routes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ public IPublishedContent FindContent(ActionExecutingContext actionExecutingConte
228228
}
229229
```
230230

231-
We start off by getting our product root using the `UmbracoContext` to get it based off its id. Next we need to figure out what action is being requested, to do this we cast the `actionExecutingContext.ActionDescriptor` to a `ControllerActionDescriptor` and use its `ActionName` property. If the action name is index, we just return the product root, but if it's product, we try to get the SKU from the route value `id`, and try to find the child node which matches the SKU and return that.
231+
Start by retrieving the product root using the `UmbracoContext` to obtain it based on its ID. Next, let's figure out what action is being requested. To do this, cast the `actionExecutingContext.ActionDescriptor` to a `ControllerActionDescriptor` and use its `ActionName` property. If the action name is index, it returns the product root. If it's a product, we get the SKU from the route value `id` and find the matching child node.
232232

233233
Now there's only one last thing to do, we need to register our shop controller, if you're creating a controller for your own site you can do it in the `Configure` method of `Startup.cs` like so:
234234

0 commit comments

Comments
 (0)