Calling Misc plugin from other plugins

4 years ago
I am new to Nop and MVC. Looking at the Nop architecture, I decided to create a Misc plugin that interfaces to our ERP system. I wanted to create this plugin to enable Nop to pull data from our ERP system and call a few methods that would create an order in our ERP system

Within the plugin, the code works fine. I am having trouble figuring out how to access this plugin from other plugins(payment method, External Auth types, etc).

Is there a way to access this plugin from other areas of Nop?

My Nop version is 3.60. I have created test pages in the admin screen to test the code functionality and the data access is working.

The install and configure environments work fine also.

I am getting information from our ERP system using SQLClient as the ERP system db can not use EF. The data is being returned as POCO objects within the plugin.

Any help would be appreciated.


4 years ago
Your plugin should handle events ...

e.g. a plugin that handles Order Update Events would have this

using Nop.Core.Domain.Orders;
using Nop.Core.Domain.Payments;
using Nop.Core.Events;
using Nop.Core.Plugins;
using Nop.Services.Orders;

namespace Nop.Plugin.MyCompany.MyPlugin

    public class MyPlugin : BasePlugin, IConsumer<EntityUpdated<Order>>

        public void HandleEvent(EntityUpdated<Order> eventMessage)

(search the forums for more examples)
4 years ago
Thanks for your answer.

I was not able to get the event to work the way I wanted so I created a service. This enabled me to share the data to all types of items.

The main goal was to customize Nopcommerce without modifying the core NopCommerce code.

During the process of creating my service, I had to register my service by adding a line to the DependencyRegistrar in the Nop.Web.Framework project.

If you know of a better way of doing this, please let me know.

Thanks again for your help.