In this article, we will talk about a visual studio extension which simplifies the nopCommerce plugin development.
Before moving on to the details of visual studio extension, let`s first briefly talk about what is nopCommerce and what are nopCommerce plugins.
nopCommerce is an open-source, free e-Commerce shopping cart. It is developed using ASP.NET MVC and MS SQL 2008 (and higher) backend database. It has various features that are applicable for all types of users. Some of the features are listed below:
As of writing of this article, current version of nopCommerce is 3.9. Currently the nopCommerce team is working on migrating the code base from ASP.NET MVC to new cross-platform ASP.NET CORE platform.
Source code and official site links are:
Plugins in nopCommerce are used to extend the functionality of nopCommerce. nopCommerce has various types of plugins like payment methods, shipping rate computation methods and much more. Like visual studio marketplace, nopCommerce has its own marketplace where we can find various types of plugins. We can also create our own plugins. You can find more information about how to create your own plugin on http://docs.nopcommerce.com/display/en/How+to+write+a+nopCommerce+plugin.
nopCommerce plugin is just a class library project. To convert this class library project into a nopCommerce plugin we need to perform some steps like change the build path for the project, add description file (provide some information regarding the plugin like its version, author, description), logo etc. Every time we start developing our own plugin, we need to add this basic stuff to our project. The most important setting is the build path. If we forgot to set the build path to a proper location, then the plugin will not be displayed in admin section in plugin list. This is where the nopCommerce plugin project template extension comes in play.
It is a visual studio extension which adds a new class library project template for nopCommerce plugin development. This project template consists of basic content like web.config file, description file, plugin configuration file etc, so that we can start with actual plugin development process. In nopCommerce project, you just need to right click on Plugins folder and select Add => New Project option as shown below (F:1).
It will open up the project dialog. Project template is visible under Visual C# => nopCommerce menu as shown below (F:2).
Select the nopCommerce Plugin Class Library project template, give it a name, make sure project location points to Plugins folder and then click on Ok button. After clicking on Ok button plugin project will be added under Plugins folder.
This project contains files like Description.txt, default logo image, plugin setting file, a controller, a view and web.config file as shown below (F:3).
Build path for the project is also set to Nop.Web\Plugins folder and output path is also set for files like Description.txt, logo image, web.config and view. So that when you build plugin, content of the plugin will get copied to Nop.Web\Plugins folder as shown below (F:4).
Note: You just need to change the version of nopCommerce according to your nopCommerce project version in Description.txt file. By default it is set as 3.90.
When you run the project and go to Plugins section in admin you will be able to see the plugin in admin section under Misc group as shown below (F:5).
In this article, we talked about nopCommerce plugin project template extension for Visual Studio 2017 and how kick start the plugin development process quickly. I hope you enjoyed reading the article.