plugin routing nop 4.00

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 years ago
I cant configure custom routes for a plugin

public void RegisterRoutes(IRouteBuilder routeBuilder)
        {
           routeBuilder.MapRoute("Plugin.Misc.WebServices.Settings", "Api/Settings",
                new { controller = "Api", action = "Settings" });

        }

the above does not work

I wish to access the controller and action without the admin area

www.domain.com/controller/action?parameter=12345tttt
like it use to be in nop 3.9

anyone
thanks
6 years ago
Hi hezyz,

I see that the only one plugin with a custom route in nopCom 4.0 is Paypal standard.

When I was adapting my payment plugin had a problem with routing because was using the CheckMoneyOrder plugin how my starting point.
Happened that the Controller was decorated with [AuthorizeAdmin] and [Area(AreaNames.Admin)] then if not place the /Admin in front of Url the action not works and receive page not found error messages.

Maybe this has some relation with your problem.

Best Regards.
6 years ago
hi nop team

anyone can address this issue
this the route

  //areas
            routeBuilder.MapRoute(name: "areaRoute", template: "{area:exists}/{controller=Home}/{action=Index}/{id?}");


the route I have set, in the first post, does not work although it gets hit

How can I define a new one in a plugin, with out the admin
for example
www.domain.com/Controller/action?parm=sdfsdfsd

I have 2 mobile apps that depends on this base url

please advice
6 years ago
anyone?
6 years ago
hezyz wrote:
anyone?



I can go through your code if you share your code it with me.

I also use, i.e  [Route("api/checkout/opccheckoutforguest")] like this .. it also works for me.

Note: try like
[Route("api/checkout/opccheckoutforguest")]
on Action
6 years ago
sohel wrote:
anyone?


I can go through your code if you share your code it with me.

I also use, i.e  [Route("api/checkout/opccheckoutforguest")] like this .. it also works for me.

Note: try like
[Route("api/checkout/opccheckoutforguest")]
on Action


hi thanks
its working, but i was thinking of setting a route for all the actions
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.