new plugin in ordering procss

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
11 years ago
i would like to build a plugin that will send an email notifcation to Vendor after order was paid

1. which   IPlugin interface sshould i implement ?

2. is there some one who can guide me  (it is my first plugin)?
11 years ago
pint12 wrote:
i would like to build a plugin that will send an email notifcation to Vendor after order was paid

1. which   IPlugin interface sshould i implement ?

2. is there some one who can guide me  (it is my first plugin)?


1. Do a MISC plugin will do

2. If you have not already done so, please follow the tutorial on https://www.nopcommerce.com/documentation.aspx. Your plugin can be done using a MISC plugin, and implementing a IConsumer of the following event

_eventPublisher.PublishOrderPaid(order);
11 years ago
GR8!!!!

ill let you all know how it is going
11 years ago
small question

i need to a service folder and a Iservice.cs
because i am not using the regular interfaces right??

could you explain more about the IConsumer ?
11 years ago
pint12 wrote:
small question

i need to a service folder and a Iservice.cs
because i am not using the regular interfaces right??

could you explain more about the IConsumer ?


Eh... I am not sure what you are going to do, but if you feel that you need a new service, then feel free to add it. Just make sure you register it in DependencyRegistrar.cs.

Regarding IConsumer, perhaps this post is useful to you: https://www.nopcommerce.com/boards/t/19049/shippmentsent-event.aspx
11 years ago
basically i done it before but  i dont by twising a bit the orderprocesservice and the massage service .

this is the code that i wrote  at
now can i implment it again . i need short expansionism   of how impliment things plz ,




//raise event        
                    if (order.PaymentStatus == PaymentStatus.Paid)
                    {
                        _eventPublisher.PublishOrderPaid(order);
                        //fileds for  dropship added by ilanp
                        //send email notifications to vendor  
                        var ml = _orderService.GetAllVendors(order.Id);

                        foreach (Manufacturer vendor in ml.Distinct())
                        {
                            if (vendor.IsDropShip == true)
                            {
                                int SendOrderPlacedVendorNotificationId = _workflowMessageService.SendOrderPlacedVendorNotification(order, _localizationSettings.DefaultAdminLanguageId, vendor);
                                if (SendOrderPlacedVendorNotificationId > 0)
                                {
                                    order.OrderNotes.Add(new OrderNote()
                                    {
                                        Note = string.Format("\"Order placed\" email (to vendor) has been queued. Queued email identifier: {0}.", SendOrderPlacedVendorNotificationId),
                                        DisplayToCustomer = false,
                                        CreatedOnUtc = DateTime.UtcNow
                                    });
                                    _orderService.UpdateOrder(order);
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception exc)
            {
                if (result == null)
                    result = new CapturePaymentResult();
                result.AddError(string.Format("Error: {0}. Full exception: {1}", exc.Message, exc.ToString()));
            }
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.