Checkout plugin

3 years ago
Hello,
I am trying to create nopCommerce plugin.I want to override nopCommerce onepagecheckout. I wrote next code in my plugin :

public class RouteProvider : IRouteProvider
    {
        public void RegisterRoutes(RouteCollection routes)
        {
            System.Web.Mvc.ViewEngines.Engines.Add(new CustomViewEngine());
             routes.MapLocalizedRoute("CheckoutOnePage",
                            "onepagecheckout/",
                            new { controller = "CheckoutTwoStepCheckoutController", action = "OnePageCheckout" },
                            new[] { "Nop.Plugin.Checkout.TwoStepCheckout.Controllers" });
            
        }

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

But when i go on localhostnumber/onepagecheckout i have next:

Please help me :)
3 years ago
I have added sample code for you, See below


public partial class RouteProvider : IRouteProvider
    {
        public void RegisterRoutes(RouteCollection routes)
        {          
            //one page check out
            routes.MapRoute("Plugin.Misc.OnePageCheckOut.OnePage",
                 "onepagecheckout",
                 new { controller = "MiscOnePageCheckOut", action = "OnePageCheckout" },
                 new[] { "Nop.Plugin.Misc.OnePageCheckOut.Controllers" }
            );                                  
        }
        public int Priority
        {
            get
            {
                return 2;
            }
        }
    }
3 years ago
roma9806mail wrote:
Hello,
I am trying to create nopCommerce plugin.I want to override nopCommerce onepagecheckout. I wrote next code in my plugin :

public class RouteProvider : IRouteProvider
    {
        public void RegisterRoutes(RouteCollection routes)
        {
            System.Web.Mvc.ViewEngines.Engines.Add(new CustomViewEngine());
             routes.MapLocalizedRoute("CheckoutOnePage",
                            "onepagecheckout/",
                            new { controller = "CheckoutTwoStepCheckoutController", action = "OnePageCheckout" },
                            new[] { "Nop.Plugin.Checkout.TwoStepCheckout.Controllers" });
            
        }

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

But when i go on localhostnumber/onepagecheckout i have next:

Please help me :)


Your code will like bellow==>Keep in mind CheckoutTwoStepCheckoutController controller name is "CheckoutTwoStepCheckout" withour Controller portion,So, controller = "CheckoutTwoStepCheckout"


public class RouteProvider : IRouteProvider
    {
        public void RegisterRoutes(RouteCollection routes)
        {
            System.Web.Mvc.ViewEngines.Engines.Add(new CustomViewEngine());
             routes.MapLocalizedRoute("CheckoutOnePage",
                            "onepagecheckout/",
                            new { controller = "CheckoutTwoStepCheckout", action = "OnePageCheckout" },
                            new[] { "Nop.Plugin.Checkout.TwoStepCheckout.Controllers" });
            
        }

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

3 years ago
sohel wrote:

Your code will like bellow==>Keep in mind CheckoutTwoStepCheckoutController controller name is "CheckoutTwoStepCheckout" withour Controller portion,So, controller = "CheckoutTwoStepCheckout"


public class RouteProvider : IRouteProvider
    {
        public void RegisterRoutes(RouteCollection routes)
        {
            System.Web.Mvc.ViewEngines.Engines.Add(new CustomViewEngine());
             routes.MapLocalizedRoute("CheckoutOnePage",
                            "onepagecheckout/",
                            new { controller = "CheckoutTwoStepCheckout", action = "OnePageCheckout" },
                            new[] { "Nop.Plugin.Checkout.TwoStepCheckout.Controllers" });
            
        }

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


Thank you very much :)