nopCommerce Follow Plugin

Project Description

Introduction

Zoombai company operates an intermediation platform allowing downloading 3D printable models posted by their creators (designers).
Downloads can be free, shareware, payable (with or without DRM).
To keep users informed about uploads carried by designers that interest them, they wanted to develop a similar service as the one for social networks ("Followers").

Features

The implementaion based on nopCommerce 3.0 (hosting on Azure) integrates and complements nopCommerce functionally. To ensure overall sustainability, it complies with the extension architecture (plug-in) proposed by the platform and is designed as a nopCommerce plug-in (knowing each plugin can implement any number of widgets).
The storage of new informations is optimized in order to minimize the number of queries:
The unique informations are stored as generic attributes (IGenericAttributeService);
Grouped informations for a single entity are stored in new and independent tables.
The classes evolution are managed by dependency injection without changing the kernel.
The development is multilingual, "desktop" and "mobile" supported (following the paradigm implemented by the platform).
User interface's public elements are fully customizable by CSS.
Error messages is recorded into the nopCommerce log, as possible, errors will be managed in a silent way so that it won’t degrade the user experience.
Sources are fairly commented and both literals samples and comments are in English.
The following deliverables was provided:

  • The C# project (VS 2012) (with all sources) to generate the plug-in.
  • XML file for localization strings

General description

About the “designer” term : technically, designers are manufacturers within the nopCommerce meaning.
This development allows identified users to follow the designer new publications they want to follow, to manage their subscriptions and to display counters for reporting.
The development consist to achieve:

  • A "Follow" widget displaying the current designer’s number of followers, and a button allowing to "Follow" (or “Unfollow”) the designer, which can be placed in the product or designer pages.
  • a "NumberOfFollowed" widget showing the number of designers followed by the current user.
  • a "ListOfFollowed" page listing the designers followed by the current user and allowing to access to the designer page or to stop to follow him/her.
  • a "Dashboard" page listing from the most recent to the oldest, descriptions of models created or updated by designers followed by the user.

Storage

The informations needed to run the plugin is stored in three tables:

Follower_Mapping

  • Id
  • CustomerId (user id)
  • ManufacturerId (manufacturer id)

This table is store the “following” relationship between user and manufacturer.

ManufacturerExt

  • Id
  • ManufacturerId
  • NumberOfFollowers (number of users following the designer).

This table is allow retrieving directly the number of users by whom a manufacturer is followed. The NumberOfFollowers field is updated each time the Follower_Mapping table is modified. The record associated to a manufacturer is created on first use (reading or updating) if it wasn’t exist.

CustomerExt

  • Id
  • CustomerId (user id)
  • NumberOfFollowed (number of followed designers)

This table allows retrieving directly the number of designers followed by a user. The NumberOfFollowed field is updated each time when the Follower_Mapping table is modified. The record associated to a user is created on first use (reading or updating) if it wassn’t exist.
The above tables is neither created nor destroyed during the installation or uninstallation of the plugin, if a table or a field was missing from the database during the installation, an error message is displayed (cf . Annex "RecordMap example.txt").

Detailed description

Widget « Follow »

This widget displays the number of users following the current designer (the designer himself in its page, the designer of the product in a product page) and provides a link to:
"follow" this designer if he or she is not already followed by the current user
orĀ 
- "stop follow" if he or she is already followed (if the user isn’t identified, the designer will be deemed not being followed).
If the user is logged in, the activation of the link is cause the update of the tables described above depending on the action displayed (ie creation / destruction of the recording linking the current user and the current designer in the table Follower_Maping and update / creation of the counters in the records associated with the current user and the current designer in the CustomerExt and ManufacturerExt tables) and returns the user to the current page (updated concerning the number of followers).
If the user is not logged in, he or she will be first sent to the login page before the actions described above are carried out in case of successful identification.
The plugin configuration page contains for this widget a text field to enter multiple locations separated by commas. If this field is left blank, the widget isn’t displayed.

Widget « NumberOfFollowed »

This widget shows the number of designers followed by the current user, retrieved in the CustomerExt table.
The plugin configuration page contains for this widget plugin a text field to enter multiple locations separated by commas. If this field is left blank the widget isl not displayed.

Page « ListOfFollowed »

This page page is accessible at the URL : "/customer/followed" and integrates the "MyAccount" area. As such, it contains the "MyAccountNavigation.cshtml » menu in its left column.
The page lists the designers followed by the current user in the order of their names and displays for each of them:

  • his or her image
  • his or her name
  • A link to stop following him or her (“Unfollow”)

The name and image’s designer is clickable and points to the designer page
Activation of the "Unfollow" link causes the update of the tables described above (ie destruction of the records liking the user and the current designer in the Follower_Maping table and update of the counters in the records related to the current user and the designer in the CustomerExt and ManufacturerExt tables) and returns the user to the current page.

Page « Dashboard »

The "Dashboard" page is accessible at the URL “/Dashboard” if the user was identified.
Otherwise, the user is sent to the login page before return to /Dashboard in case of successful identification.
This page contains the paged list of additions or updates of the models achieved by designers followed by the current user, from the newest to the oldest.
Each page contains 10 items which is preceded and followed by the nopCommerce standard control paging. In order to reduce the needed resources to display each page, only the products displayed is requested in the database.
Each addition or update is represented by a block containing the following information:

  • The designer name followed by the text "published a model -" and the date of change (or creation)
  • The designer’s image
  • The first product’s image
  • The product title
  • The product description

The blocks have the same height, a "Read more" link will be, if necessary, placed under the model description text to show the entire text and will be replaced by a link "Read Less" doing the opposite.
The designer name and image is clickable and point to the designer page.
The model’s image, title and description are clickable and point to the product page.
All items is displayed in the current language.

Project Details

Date:

August 2013

Tags:

Latest Works

Mark's website

Mark's is USA most knowledgeable team of Plumbing Parts with 30 years experience and more than 1 million products online.

nopCommerce B2B Kramer website

Kramer Electronics Russia. Professional switching equipment for the AV market. Online catalog and B2B platform.

nopCommerce new xDalys website

New website for one of the largest new and used automotive parts supply in Lithuania