plugin routing nop 4.00

Posted: November 14, 2017 at 10:16 AM Quote #196169
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
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)
Hezy Ziv

www.hz-dev.com
(free Nop Plugins)
Posted: November 15, 2017 at 6:52 AM Quote #196233
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.
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)
The stairs of Humility have low and large degrees, the one of pride... High and straits degrees...
Posted: November 16, 2017 at 5:46 AM Quote #196294
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
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)
Hezy Ziv

www.hz-dev.com
(free Nop Plugins)
Posted: November 18, 2017 at 2:33 AM Quote #196418
anyone?
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)
Hezy Ziv

www.hz-dev.com
(free Nop Plugins)
Posted: November 18, 2017 at 3:38 AM Quote #196420
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
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 in any of these areas-Elastic search| Customization| Plugins| Themes| Upgrade| Server Setup (Hosting) |Consultancy| API? I’m just a click way!
Skype: misohel@hotmail.com, sohel.bs23
Posted: November 19, 2017 at 5:37 AM Quote #196452
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 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)
Hezy Ziv

www.hz-dev.com
(free Nop Plugins)
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.