Order emails not going out for $0.00 orders

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 years ago
Nop 3.8.

We use a 100% discount code when entering warranty replacement parts to a customer. We've noticed that the customer doesn't receive emails for these $0.00 orders. They do not exists in the message queue.
6 years ago
Bump
6 years ago
It appears to be that way by design:

        public virtual PlaceOrderResult PlaceOrder(ProcessPaymentRequest processPaymentRequest)
        {
           ...
                //process payment
                ProcessPaymentResult processPaymentResult = null;
                //skip payment workflow if order total equals zero
                var skipPaymentWorkflow = details.OrderTotal == decimal.Zero;

           ...
                if (processPaymentResult.Success)
                {
           ...
                    //notifications
                    SendNotificationsAndSaveNotes(order);
6 years ago
What exactly email do you mean? Order placed? Order paid? Order shipped? Completed?
6 years ago
a.m. wrote:
What exactly email do you mean? Order placed? Order paid? Order shipped? Completed?


Sorry - Order Paid. I realize that it is a zero dollar order, but it is paid (meaning there is nothing due), which is also the status of a $0 order in Nop (it's status is PAID).

We use this when a customer either has enough rewards points, or gets a warranty, or promotional order.
6 years ago
bump
6 years ago
chadwixk wrote:


Sorry - Order Paid. I realize that it is a zero dollar order, but it is paid (meaning there is nothing due), which is also the status of a $0 order in Nop (it's status is PAID).

We use this when a customer either has enough rewards points, or gets a warranty, or promotional order.


It makes sense that the OrderPaid event is not triggered if no payment is processed.  
I'd suggest adding an IConsumer for the order placed event, and if the order total is 0, manually trigger the email.

Something similar to:



public class OrderPlacedEventConsumer : IConsumer<OrderPlacedEvent>
    {
        private readonly IWorkflowMessageService _workflowMessageService;

        public OrderPlacedEventConsumer(IWorkflowMessageService workflowMessageService)
        {
            _workflowMessageService = workflowMessageService;
        }

        public void HandleEvent(OrderPlacedEvent eventMessage)
        {
             if(eventMessage.Order.OrderTotal <= decimal.Zero)
             {
             _workflowMessageService.SendOrderPaidStoreOwnerNotification(eventMessage.Order, eventMessage.Order.CustomerLanguageId);
             }
        }
    }


This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.