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()));
}