Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

NopCommerce Demo Widget -1 Part

0.00/5 (No votes)
22 Oct 2015 1  
In this post, I will explain in a step by step manner how to setup Nop Commerce.

There are a lot of open source ecommerce platform on the web. One of them which is very popular is Nop Commerce. I will show in a series of posts how to develop one demo widget in this platform.

In this post, I will explain how to setup plugin step by step. In the following posts, we will go deeper and develop the administrative part – configuration of our plugin visible for logged administrators of ecommerce portal, and of course later the part which is public – visible for all users. So let’s begin. :)

First, we should download ecommerce solution from link: HERE.

After opening this solution in Visual Studio, there are a lot of projects. During this series of posts, we will explain in detail the role of all projects. For now, we will jump right to the folder Plugins. Here is all the magic happening. We should start with adding new Class Library Project. Right click mouse on Folder Plugins -> add new project and we will see window:

Slika1

Then, you should copy paste from any other existing plugin projects files: Description.txt and web.config. File Class1.cs should be deleted.

Slika2

In description.txt file should be text something like this:

Group: Widgets
FriendlyName: DemoWidgets
SystemName: Widgets.DemoWidgets
Version: 1.0
SupportedVersions: 3.60
Author: Vladimir Skipic Skipic.Net
DisplayOrder: 1
FileName: Nop.Plugin.Widgets.DemoWidgets.dll

Most important field here is FileName because bNopCommerce will search and find our plugin DLL with this field. In field Support versions, we can enter comma separated versions if your plugin support for example 3.5 and 3.6 versions in this field will be:

SupportedVersions: 3.50, 3.60

text.

Web Config file will remain the same. Now, we should mouse right click on our project folder. And when we open popup window, we should choose 4.5.1 .NET Framework.

Slika3

On the same window in Build tab, we should enter in Output path this value ..\..\Presentation\Nop.Web\Plugins\Widgets.DemoWidget\.

Slika4

Reason for this is that after we rebuild our plugin demo widget project, output of build should be in Presentation\Nop.Web\Plugins\ folder where are outputs of all Plugin projects which are already in NopCOmmerce solution.

Slika5

Just make sure to put value in output path field ..\..\Presentation\Nop.Web\Plugins\Widgets.DemoWidget\ in All Configuration to be sure that will be rebuilt properly for every configuration – release and debug, etc.

Slika6

Because we created project as class library, we should add references:

System.Web

Slika7

  1. System.Web.dll from standard .NET assemblies
  2. System.Web.Mvc.dll same DLL version which is used by NopCommerce already. This version should be used to avoid eventual issues in future build. DLL is in directory: nopCommerce_3.60_Source\packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45
  3. Nop.Core.dll from nopCommerce_3.60_Source\Libraries\Nop.Core\bin\Debug, Nop.Data.dll from nopCommerce_3.60_Source\Libraries\Nop.Data\bin\Debug, Nop.services.dll from nopCommerce_3.60_Source\Libraries\Nop.Services\bin\Debug, Nop.Web.Framework.dll from nopCommerce_3.60_Source\Presentation\Nop.Web.Framework\bin\Debug

If you wish, you can add text file in your project Licence.txt Text in this file could be for example:

Licensed under GPLv3.

Ok. That is all for the first step. Here, we covered the basic steps for developing our demo widget. Actually, we are ready to start with data layer and admin layer.

If you like, you can comment on this post. See you in the next post :)

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here