Here is RouteProvider inside the plugin:
public void RegisterRoutes(RouteCollection routes)
{
routes.MapLocalizedRoute("Nop.Plugin.APEX.Catalog.OverridenCategory",
"{SeName}",
new { controller = CONTROLLER, action = "OverridenCategory"},
new[] { NAMESPACES });
}
public int Priority
{
get
{
return 20;
}
}
Here is CatalogController inside the plugin:
public partial class CatalogController : Nop.Web.Controllers.CatalogController
{
[ActionName("OverridenCategory")]
[NopHttpsRequirement(SslRequirement.No)]
new public ActionResult Category(int categoryId, CatalogPagingFilteringModel command)
{
//
//
//
}
}
But when I run the code I see an error as follows:
The parameters dictionary contains a null entry for parameter 'categoryId' of non-nullable type 'System.Int32' for method 'System.Web.Mvc.ActionResult Category(Int32, Nop.Web.Models.Catalog.CatalogPagingFilteringModel)' in 'Nop.Plugin.APEX.Catalog.Controllers.CatalogController'. An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter.
Parameter name: parameters
Any idea how to convert "{SeName}" into {categoryId}?