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:
Then, you should copy paste from any other existing plugin projects files: Description.txt and web.config. File Class1.cs should be deleted.
In description.txt file should be text something like this:
Author: Vladimir Skipic Skipic.Net
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
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.
On the same window in Build tab, we should enter in Output path this value ..\..\Presentation\Nop.Web\Plugins\Widgets.DemoWidget\.
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.
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.
Because we created project as class library, we should add references:
- System.Web.dll from standard .NET assemblies
- 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
- 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