The 5th annual nopCommerce conference will take place in India on the 10th-11th of October. Please find more about this event here

Checkout plugin

Posted: October 28, 2016 at 9:28 AM Quote #177949
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 :)
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: October 28, 2016 at 12:41 PM Quote #177963
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;
            }
        }
    }
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: October 29, 2016 at 3:23 AM Quote #177976
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; }
        }
    }

This post/answer is useful
1
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Need help-Algolia/Elastic Search| Customization| Plugins| Themes| Upgrade|Hosting|Consultancy| API? I’m just a click away!
Skype: [email protected]
Web: http://www.nop-station.com/
Posted: October 31, 2016 at 9:47 AM Quote #178039
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 :)
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Premium support services
  • Dedicated premium support services provided by core developers are intended for persons who run mission critical websites, work on projects with tight deadlines, or want to get dedicated support.
Professional services
  • Want to open a new store? Want to take your store to the next level? Need a custom extension? We can customize nopCommerce to fit your store perfectly. Request a quote to get started.