nopCommerce Plugin Project Template For Visual Studio 2017

ASP.NET MVC, C#, ASP.NET Core, nopCommerce

0 ( 0 votes) | 302

In this article, we will talk about a visual studio extension which simplifies the nopCommerce plugin development.

Introduction:

Before moving on to the details of visual studio extension, let`s first briefly talk about what is nopCommerce and what are nopCommerce plugins.

What is nopCommerce?

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:

  1. Mobile Friendly UI
  2. SEO Friendly
  3. Support more than 50 payment methods and gateways.
  4. Supports various shipping requirements
  5. Supports various product features like product attributes, product comparison, stock management etc.

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:

  1. https://github.com/nopSolutions/nopCommerce
  2. https://nopcommerce.com/

What Are Plugins In nopCommerce?

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.

nopCommerce Plugin Project Template For Visual Studio 2017:

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).

Add New nopCommerce Plugin Project

It will open up the project dialog. Project template is visible under Visual C# => nopCommerce menu as shown below (F:2).

Project Dialog Window

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).

nopCommerce Plugin Project Template

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).

Compiler Version Of Plugin

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).

Plugin Is Now Visible In Plugin List In Admin

You can download this extension from the VS Gallery or get the CI build. Source code for this project template is available on GitHub.

Conclusion:

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.

Happy Coding!

Manoj Kulkarni - Dotnetcontext

Manoj Kulkarni

I am programmer, passionate blogger and foodie. I live in Nashik. I am a .Net developer. I like to learn new technologies to keep my self-updated and share that knowledge with my blog readers, friends and colleague.

Add a new comment