Plugin to overrides the default controller

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
8 years ago
batmaci wrote:
Okay I have fixed the issues.


public partial class RouteProvider : IRouteProvider
    {
        public void RegisterRoutes(RouteCollection routes)
        {
            ViewEngines.Engines.Add(new CustomViewEngine());

            var route = routes.MapLocalizedRoute("Register2",
                 "register",
                 new { controller = "Customer", action = "Register" },
                 new[] { "Nop.Plugin.Misc.Enhancement.Controllers" }
            );
        }

        public int Priority
        {
            get { return 100; }
        }
    }


But this will overrite entire Customer controller. What if you want to only override only Register action? is it possible?


batmaci, it won't override entire customer controller for that sample, it only override register, other action still go to original. May be you can try using ActionFilterAttribute to override the action as well
7 years ago
I'm stuck in Search Controller. this is my route

  public void RegisterRoutes(RouteCollection routes)
        {
            // Product Search,
            routes.MapRoute("Plugin.Misc.Twigoh.Search",
             "Search",
             new { controller = "Catalog", action = "Search" },
             new[] { "Nop.Plugin.Misc.Twigoh.Search.Controllers" });


        }
        public int Priority
        {
            get
            {
                return 100;
            }
        }
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.