After update payment status on order for downloadeble products qty set to zero.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Il y a 6 ans
Hi!
I see the situation - after update payment status qty for downloadeble products set up to 0.
As I see it done somewhere else than in OrderProcessingService:



   protected virtual void ProcessOrderPaid(Order order)
        {
            if (order == null)
                throw new ArgumentNullException("order");

            //raise event
            _eventPublisher.Publish(new OrderPaidEvent(order));
            // -- after this qty set to 0

            //order paid email notification
            if (order.OrderTotal != decimal.Zero)
            {
                //we should not send it for free ($0 total) orders?
                //remove this "if" statement if you want to send it in this case

                var orderPaidAttachmentFilePath = _orderSettings.AttachPdfInvoiceToOrderPaidEmail ?
                    _pdfService.PrintOrderToPdf(order) : null;


So I know how to use HandleEvent but I cannot find the correct one.
Il y a 6 ans
Are you developing a plugin? I would like to suggest to handle it separately.


public class OrderPaidEvents : IConsumer<OrderPaidEvent>
{
   public void HandleEvent(OrderPaidEvent eventMessage)
   {
     var orderData = eventMessage.Order;          
   }
}

Il y a 6 ans
Yes sure. The question was i have several plugins and i cant find one wich use event OrderPaied and set up qty for items to zero. But i find it at last - so question is solved!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.