Blog

Read About What We Love: Web Development & Technologies

How to use nopCommerce learning tools

How to use nopCommerce learning tools

The document contains information in accordance with nopCommerce version 3.9.

From a technology perspective, for nopCommerce 3.9, knowledge of MVC (Model View Controller) is very important. Dotnet MVC allows separation of concerns, and forms the core of nopCommerce. MVC is sometimes called 'architectural pattern', and sometimes 'design pattern' - depending on how we use it. There are multiple versions of Dotnet MVC - MVC 1, MVC 2, MVC 3, MVC 4, MVC 5, and lastly MVC 6 which was later renamed and integrated with .Net Core. For nopcommerce 3.9, knowledge of MVC 4 is sufficient.

Second-most important is a solid understanding on the concepts of Dependency Injection (DI), specifically, constructor-based dependency injection. “Autofac” is used here to achieve DI. However, if you have worked with other DI tools such as Unity, you're good to go. While implementation of Autofac and Unity differ slightly, overall, the concept remains the same.

Third, knowledge of Entity Framework is required. Entity Framework (EF) is an open source object-relational mapping (ORM) framework for ADO.Net and simplifies the code. Using the Entity Framework, developers issue queries using LINQ, then retrieve and manipulate data as strongly typed objects. The Entity Framework's ORM implementation provides services such as change tracking, identity resolution, lazy loading, and query translation, so that developers can focus on their application-specific business logic rather than the data access fundamentals.

Three different approaches are available for working with Entity framework: Code-first, Model-First and Database-First. Database-First approach automatically generates model classes for the solution. nopCommerce uses the Code-first approach.

Fourth, for client-side coding, Javascript, JQuery, CSS, HTML and Bootstrap is required. Refer to tutorials at W3Schools for a basic understanding on all of these.

Fluent API is integrated with nopCommerce 3.9 for field level validation. While MVC also allows validation attributes, Fluent API segregates validations rules and helps in keeping the code clean.

Though not mandatory, Automapper can be used with new plugin development. It allows automatic mapping of Models to View Models and vice-versa, reducing LOC (Lines of Code).

nopCommerce 3.9 uses Redis cache for cache management while SQL database is used for storing data. Hence, sopme level of SQL and Redis knowledge is required for nopCommerce plugin development. CRUD (Create, Read, Update, Delete) operations on database are performed via LINQ (Language Integrated Query) which again is a part of C#.Net. Good hands-on in LINQ knowledge can help in quick and effective completion of controller code.

nopCommerce 3.9 also allows Azure and Git deployment. AzurePictureService uses Blob Storage for saving and fetching images. If your plugin is using AzurePictureService, learn about Blob Storage and Blob Container types in detail. This will help with understanding concepts of data storage in Azure and blobs.

OData protocol is used in RESTful APIs for filtering the data. If you are making a plugin based on RESTful APIs, use OData for fast retrieval of data. It provides some awesome features – filtering data based on parameters appended with API URL, so you don’t have to filter it again.

Implementation of the Installation and Uninstallation process is very simple in nopcommerce. Inherit “BasePlugin” class and implement override methods.

public override void Install ()
        {
              base.Install();
                }
 
public override void Uninstall ()
        {
              base.Uninstall();
                }

Localization is achieved in nopCommerce using “Nop.Services.Localization” namespace. On using “AddOrUpdatePluginLocaleResource” and “DeletePluginLocaleResource” methods, the SQL table containing localized resources is updated.

this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.Slider.CreateImageMessage", "Please create and save a slider before creating an image");

this.DeletePluginLocaleResource("Plugins.Widgets.Slider.CreateImageMessage");

If you have any queries on nopCommerce learning tools, or any any other question in general, do get in touch with us. We'll be happy to help!

Rahul Mittal | Technical Lead

Leave A Comment

Transform your business

We'll get in touch with you ASAP!


Contact us