Remove existing route and inject new route in nopCommerce 4.00 via plugin

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
5 năm cách đây
Hello,

I want to remove existing route from RouteCollection and want to add new route with same route name - HomePage via plugin.

Existing route name:

//home page
            routeBuilder.MapLocalizedRoute("HomePage", "",
        new { controller = "Home", action = "Index" });



Want to replace it with


            routeBuilder.MapLocalizedRoute("HomePage", "",
        new { controller = "CustomPage", action = "Homepage" });



I tried several ways but not get any luck.
5 năm cách đây
I believe you should be able to achieve this by having the Order property of your RouteProvider return -100000 or something like that.
5 năm cách đây
It will give error with Route already exist with name 'HomePage'.
5 năm cách đây
Anyone have idea on this?

I posted same post on stackoverflow
5 năm cách đây
I've answered it on StackOverflow.
5 năm cách đây
Thank you. I’ll check and update answer and post solution here if it worked.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.