Plugin Development Overview
Welcome to the nopCommerce plugin development guide. This section covers everything you need to know to build powerful, maintainable plugins.
What are Plugins?
Plugins are self-contained modules that extend nopCommerce functionality without modifying the core code. They follow a standardized structure and can be:
- Installed/Uninstalled at runtime from the admin panel
- Distributed as NuGet packages or ZIP files
- Updated independently of the core platform
Plugin Types
nopCommerce supports several plugin types, each serving a specific purpose:
| Type | Description | Example |
|---|---|---|
| Payment | Process payments | Stripe, PayPal, Braintree |
| Shipping | Calculate shipping rates | UPS, FedEx, DHL |
| Tax | Calculate taxes | Avalara, TaxJar |
| Widgets | Display content in widget zones | Banners, sliders, chat |
| Misc | General-purpose functionality | Export/Import, SEO tools |
| External Auth | Third-party authentication | Google, Facebook, Azure AD |
| Multi-Factor Auth | 2FA/MFA providers | Google Authenticator |
| Pickup Points | Store pickup locations | Click & Collect |
Quick Start
Create a basic plugin in 5 steps:
csharp
// 1. Create the plugin class
public class MyPlugin : BasePlugin
{
public override async Task InstallAsync()
{
await base.InstallAsync();
}
public override async Task UninstallAsync()
{
await base.UninstallAsync();
}
}Ready to Build?
Jump to Creating a Plugin for a complete step-by-step tutorial.
Plugin Capabilities
Your plugins can:
- ✅ Add new admin pages and menus
- ✅ Create public-facing pages and widgets
- ✅ Add custom database tables
- ✅ Subscribe to system events
- ✅ Override existing services
- ✅ Add scheduled background tasks
- ✅ Extend product/customer/order entities
- ✅ Add custom settings and configurations
- ✅ Include localized resources
Architecture at a Glance
Your Plugin
│
├── References Nop.Core, Nop.Services, Nop.Web.Framework
│
├── Registers services via DI (Dependency Injection)
│
├── Can consume events from IConsumer<TEvent>
│
└── Integrates with MVC (Controllers, Views, Models)In This Section
| Page | Description |
|---|---|
| Architecture | How the plugin system works |
| Creating a Plugin | Step-by-step plugin creation |
| Plugin Structure | Files and folder conventions |
| Services & DI | Working with dependency injection |
| Database | Data access and migrations |
| Admin UI | Building admin interfaces |
| Frontend | Public store integration |
| Events | Event-driven programming |
| Scheduled Tasks | Background job processing |
| Localization | Multi-language support |
| Configuration | Plugin settings |
| Best Practices | Tips and recommendations |
Prerequisites
Before starting plugin development, ensure you have:
- ✅ nopCommerce source code set up
- ✅ Visual Studio 2022 or JetBrains Rider
- ✅ Basic knowledge of C# and ASP.NET Core
- ✅ Understanding of dependency injection concepts