Implementing Events in nopCommerce

Event is a very common feature in Today’s Web Sites. Stores that arrange Events for the Customers may require this feature. Though nopCommerce has not yet given this feature, I had to implement this of my own for a customer. This is implemented on nopCommerce 1.30. I know that is very old version though hoping it can be a primer for the developers who are working with this wonderful DotNet Project. I am providing here the steps that you will need to implement this feature:

Step 1: Please download the files from this Link.

Step 2: Follow the instruction in the instruction.txt for placing the files in specific places.

Step 3: Make the following changes in the Store’s web.config. In the section group “nopDataProviders” add this entry:

<section name="EventProvider" 
type="NopSolutions.NopCommerce.DataAccess.
Content.Event.DBEventProviderSection, 
Nop.DataAccess" requirePermission="false"/>

And in the “namespaces” section add the following line:

<add namespace="NopSolutions.NopCommerce.Common.Content.Event"/>

In nopDataProviders section add this piece of codes:

<EventProvider defaultProvider="SQLEventProvider">
<providers><add name="SQLEventProvider"
type="NopSolutions.NopCommerce.DataAccess.Content.Event.SQLEventProvider, 
Nop.DataAccess.SqlServer" connectionStringName="NopSqlConnection"/>
</providers></EventProvider>

Add the following item in the Administration\web.cofig

<add namespace="NopSolutions.NopCommerce.Common.Content.Event"/>

Step 4: Make the following changes in the Administration/Site.Master file:

a. find this line in the file:

<siteMapNode title="Polls" url="~/Administration/Polls.aspx" 
description="Manage Polls"/>

b. Paste the following lines just below it:

<siteMapNode title="Event" url="~/Administration/EventHome.aspx" 
description="Event Home">        
<siteMapNode title="Event Settings" 
url="~/Administration/EventSettings.aspx" 
description="Manage Event Settings"/>        
<siteMapNode title="Manage Event" 
url="~/Administration/Event.aspx" 
description="Manage Event"/>        
<siteMapNode title="Event comments" 
url="~/Administration/EventComments.aspx" 
description="Manage Event Comments"/>
</siteMapNode>

Step 5: Add the following section in the UrlRewrite.config:

<add name="EventDetailsRewrite" 
virtualUrl="^~/Event/([0-9]*)-([\w-]*)\.aspx(?:\?(.*))?"         
rewriteUrlParameter="ExcludeFromClientQueryString"         
destinationUrl="~/Event.aspx?EventID=$1&amp;$3"         
ignoreCase="true" />

Step 6: Run the SQLs.sql from the Sqls folder in your DB to create the tables and stored procedures.

Step 7: Then run the program with a link at your store for the Events.aspx Page.

You can have a live demo in the site: http://www.sandalaproductions.com

Happy Coding!

Advertisements

7 thoughts on “Implementing Events in nopCommerce

  1. Hi, i was trying to add events to my project, but I’am facing a problem, where

    can fit into web.config

    trow me an error

    Any help?

    Thanks

      1. Do you have any instructions? I’m new to nopcommerce and I think some of the structure/folders have changed since 1.30 so i’m a bit confused! Thanks!

  2. Greetings

    kindly,
    I want to implement an Event page in Nopcommerce 3.2,
    its easy to add a new page to the NopCommerce, but the problem is
    how to access the new create events tables in database and display them in the screen without using the context used in NopCommerce
    Any help please !!!

    1. HI,

      Sorry for the late response. I was quite away from nopCommerce for a while. Now I am back to this amazing framework. I will try to write a post for adding a new feature from the scratch on the latest version. I hope you won’t mind waiting till then.

      Thanks.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s