Hi,
I'm building my own check-out & register logic.
So for this I have my own IRouteProvider implementation and it works.
However once in a while I get things like:
Exception message: A route named 'Register' is already in the route collection. Route names must be unique.
How can I fixed this ?
public class RouteProvider : IRouteProvider
{
public void RegisterRoutes(RouteCollection routes)
{
routes.Remove(routes["CustomerMyAccount"]);
routes.Remove(routes["CustomerInfo"]);
routes.Remove(routes["Register"]);
routes.Remove(routes["RegisterResult"]);
routes.MapLocalizedRoute("CustomerMyAccount",
"customer/myaccount",
new { controller = "xxxCustomer", action = "MyAccount" },
new[] { "Nop.Plugin.xxx" });
routes.MapLocalizedRoute("CustomerInfo",
"customer/info",
new { controller = "xxxCustomer", action = "Info" },
new[] { "Nop.Plugin.xxx" });
routes.MapLocalizedRoute("Register",
"register/",
new { controller = "xxxCustomer", action = "Register" },
new[] { "Nop.Plugin.xxx" });
routes.MapLocalizedRoute("RegisterResult",
"registerresult/{resultId}",
new { controller = "xxxCustomer", action = "RegisterResult" },
new { resultId = @"\d+" },
new[] { "Nop.Plugin.xxx" });
}
public int Priority
{
get { return 0; }
}
}
What does Priority do ?