Reputation:
I am new in NopCommerce
developing a small plugin for personal use. My problem is I am trying to add a extra tab menu item in the menu bar in Admin panel. I have gone through the documentation of doing this types of work. But I am totally confused what they are saying, where I have to add those provided code.
According to the official documentation I am failed to understand because I don't have or used the Plugin.cs
file where I have to implement interface IAdminMenuPlugin
. So Where can I implement these method. My major problem is I don't know what is the work of plugin.cs file. Because I didn't find any such class in existing plugin
which are provided in NopCommerce
framework. I am using 3.80
version of it.
Upvotes: 2
Views: 420
Reputation: 2414
The plugin.cs you are looking for, is the file containing the class that implements Nop.Core.Plugins.IPlugin
interface, that class is the one where implement IAdminMenuPlugin
.
All the official plugins implement IPlugin
inheriting from Nop.Core.Plugins.BasePlugin
class, for example, NivoSliderPlugin.cs
declares NivoSliderPlugin
class and inherits from BasePlugin
.
NopCommerce will autodiscover all this plugins (the IPlugin
interface implementation) and load them into the system and if this class implements IAdminMenuPlugin
the ManageSiteMap
method will be called
So you will need something like this:
public class CustomPlugin : BasePlugin, IAdminMenuPlugin
{
...
public void ManageSiteMap(SiteMapNode rootNode)
{
// here you can manage the menu from rootNode
}
...
}
Upvotes: 2