How to - Extending nopCommerce v2.0

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 years ago
New York wrote:
Thanks, that worked.  
I was just diff'ing your published extension against what I had got from your atricle, and noticed you made similar correction to index.cshtml
I had some other problems with what I cut/paste form your article - there are missing characters, and extra <pre> and stuff like that. (I wish I had noticed the published ext a few hours ago :)

Also, in the article, you should mention to create a new Class Library project.  I first created an empty MVC3 project, and that would cause two instances of the ASP.NET server to run.
You may also want to mention adding this Reference
  Browse - …src\packages\FluentValidation.2.0.0.0\lib\NET35\FluentValidation.dll

Thanks again.


Thank you for your feedback "New York". I'll make the modifications you recommend. I use Resharper during development which makes adding references a lot easier and it is easy to forget to document them. I wrote that article as I was writing the plugin to ensure it was working correctly, but a combination of me getting lazy and changes to how I wanted the code structured introduced differences between the blog and the plugin code. Thanks for your feedback.
12 years ago
@skyler.severns

I was wondering if you can help us developing a payment integration plugin for EBS? Awaiting your response.
12 years ago
skyler.severns wrote:

-Adding a new entity


It is not ready yet. Does anybody know about another blog/thread with such tutorial?

Thank you in advance,
Serge.
12 years ago
Hi skyler

Are you still making a tutorial on how to add a new entity?

thanks
12 years ago
tmathura wrote:
Hi skyler

Are you still making a tutorial on how to add a new entity?

thanks


Yup. I'll make one this weekend.
12 years ago
OK, I've added a new post explaining how to create a new plugin that has a new database entity. I hope it helps and let me know if I need to change something.

http://blog.csharpwebdeveloper.com/2011/09/23/nopcommerce-plugin-with-data-access/
12 years ago
jariwalakrunal wrote:
@skyler.severns

I was wondering if you can help us developing a payment integration plugin for EBS? Awaiting your response.


@Jariwalakrunal,

I'll look into it, but I don't think I'll have time. I'm trying help as much as I can in my spare time and that would be too large of a project for "spare time". I would be happy to help answer questions for anyone who takes the project on.


Unrelated to Jariwalakrunal's post I've added a new article. It is a "cheat sheet" for the different upgrade resistant ways to extend nopCommerce functionality.

http://blog.csharpwebdeveloper.com/2011/09/27/cheat-sheet-for-effectively-extending-nopcommerce/
12 years ago
skyler.severns wrote:


I'm also interested in hearing different topics that people would like an article on. Please keep the ideas to nopCommerce version 2.0. I won't be doing any articles on previous versions.

---------------
Does the Admin web support plugins?  If so, how to create an Admin plugin would be a great article.
---------------

Hey New York,

Yes the admin section supports plugins. It will be the same process either way, but I'll be sure to add some context on how to differentiate between public and admin functionality.


Would you be able to provide a basic outline of the steps required to create an Admin Plugin?
12 years ago
Hi All

I added a plugin with route as follows;

routes.MapRoute("Nop.Plugin.Orders.LineItems", "Plugins/LineItems/List", // The route name, and the actual route.
                                                            new { controller = "LineItems", action = "List" }, // Route defaults
                                                            new[] { "Nop.Plugin.Orders.LineItems.Controllers" }); // The namespace where controllers are stored


And now i want to access that through Admin section.. say from List.cshtml in Orders.
So i added <a title="Order Line Item" href="@Url.RouteUrl("Nop.Plugin.Orders.LineItems")">Order Line Item</a> in that view.

When I click I m gettin resource not found error;

"Server Error in '/' Application.
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.

Requested URL: /Plugins/LineItems/List"

Please please help me on this..
12 years ago
I was able to resolve that issue.

When I add this plugin to Admin.. I am getting some errors;

[HttpException (0x80004005): A public action method 'RssHeaderLink' was not found on controller 'Nop.Admin.Controllers.NewsController'.]
   System.Web.Mvc.Controller.HandleUnknownAction(String actionName) +146
   System.Web.Mvc.Controller.ExecuteCore() +133
   System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +97
   System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +10
   System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +37
   System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +21
   System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +12
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
   System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +50
   System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f) +7
   System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +22
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +60
   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
   System.Web.Mvc.<>c__DisplayClassa.<EndProcessRequest>b__9() +23
   System.Web.Mvc.<>c__DisplayClass4.<Wrap>b__3() +12
   System.Web.Mvc.ServerExecuteHttpHandlerWrapper.Wrap(Func`1 func) +38

[HttpException (0x80004005): Execution of the child request failed. Please examine the InnerException for more information.]
   System.Web.Mvc.ServerExecuteHttpHandlerWrapper.Wrap(Func`1 func) +110
   System.Web.Mvc.ServerExecuteHttpHandlerWrapper.Wrap(Action action) +65
   System.Web.Mvc.ServerExecuteHttpHandlerAsyncWrapper.EndProcessRequest(IAsyncResult result) +71
   System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride) +1072

[HttpException (0x80004005): Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper'.]
   System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride) +3058371
   System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage) +77
   System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm) +28
   System.Web.HttpServerUtilityWrapper.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm) +22
   System.Web.Mvc.Html.ChildActionExtensions.ActionHelper(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues, TextWriter textWriter) +497
   System.Web.Mvc.Html.ChildActionExtensions.Action(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues) +88
   System.Web.Mvc.Html.ChildActionExtensions.Action(HtmlHelper htmlHelper, String actionName, String controllerName) +10
   ASP._Page_Views_Shared__Root_cshtml.Execute() in c:\Work\Anju\Projects\nopCommerce_2.20_Source\Presentation\Nop.Web\Views\Shared\_Root.cshtml:39
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +272
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +81
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +187
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer) +52
   System.Web.WebPages.<>c__DisplayClass7.<RenderPageCore>b__6(TextWriter writer) +203
   System.Web.WebPages.HelperResult.WriteTo(TextWriter writer) +42
   System.Web.WebPages.WebPageExecutingBase.WriteTo(TextWriter writer, HelperResult content) +45
   System.Web.WebPages.WebPageBase.Write(HelperResult result) +48
   System.Web.WebPages.WebPageBase.RenderSurrounding(String partialViewName, Action`1 body) +178
   System.Web.WebPages.WebPageBase.PopContext() +338
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +196
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer) +52
   System.Web.WebPages.<>c__DisplayClass7.<RenderPageCore>b__6(TextWriter writer) +203
   System.Web.WebPages.HelperResult.WriteTo(TextWriter writer) +42
   System.Web.WebPages.WebPageExecutingBase.WriteTo(TextWriter writer, HelperResult content) +45
   System.Web.WebPages.WebPageBase.Write(HelperResult result) +48
   System.Web.WebPages.WebPageBase.RenderSurrounding(String partialViewName, Action`1 body) +178
   System.Web.WebPages.WebPageBase.PopContext() +338
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +196
   System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +220
   System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +115
   System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +303
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +13
   System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +23
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +260
   System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +177
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +343
   System.Web.Mvc.Controller.ExecuteCore() +116
   System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +97
   System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +10
   System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +37
   System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +21
   System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +12
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
   System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +50
   System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f) +7
   System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +22
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +60
   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8963149
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.