Click here to Skip to main content
15,885,365 members
Articles / All Topics

NopCommerce Demo Widget -1 Part

Rate me:
Please Sign up or sign in to vote.
4.71/5 (4 votes)
22 Oct 2015GPL33 min read 11.2K   3  
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, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)


Written By
Software Developer (Senior)
Serbia Serbia
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
-- There are no messages in this forum --