Vendor email notification when order is paid using gift card

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 years ago
Hi,
We are using Nopcommerce 3.5

The Vendor Notification is enabled when the order is marked as paid ie, 'OrderPaid.VendorNotification' Message template is active.

The notification works fine when the payment is done using one of the payment gateways - the order is marked as paid & the email is sent to the vendor. But the notifications are not sent when the order is paid using a gift card - the order is marked as paid but emails are not sent to the vendor. Is there some settings that we are missing or is this by design.

Any help will be much appreciated, currently we have to send vendor emails manually for orders paid using gift cards.

Thanks,
Insity
7 years ago
I assume you are talking about "Virtual" gift cards and not a physical card that can only be used for in-store purchases?

Why should the vendor be notified? He has nothing to ship or re-stock anyway..
It is a "virtual gift card'...so only you need to know.
7 years ago
Oh...wait...I see now...you just mean the notifications aren't sent to vendors when your customers pay by using a gift card. ..

I'm sorry. I don't know this answer. I think that there is no reason to notify the vendor about this purchase, because the gift card is not physical and is not created/offered by the vendor to begin with.
7 years ago
hi embroyo, Thanks a lot for your response. Yes I mean the notifications aren't sent to vendor when the customer pay by using a 'virtual' gift card. The customer is only paying using a virtual gift card but the items that he is buying might be physical products which needs to be shipped and inventory maintained so notification to vendor is important.

In the meanwhile I think I have figured out the cause of this issue, I am yet to do code changes and test it out properly to see if this piece of code is the cause of this issue, which I will be doing in the coming days.

When an order is fully paid using a virtual gift card only the order total of the order is 0. There is a 'if condition' in the method 'ProcessOrderPaid' in 'Libraries\Nop.Services\Orders\OrderProcessingService.cs' which says that if the order total is zero then don't send any 'Paid' email Notifications. Code is pasted below (this 'if condition' is present in Nop 3.8 also). I have to remove this 'if condition' and test it out.

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

            //raise event
            _eventPublisher.Publish(new OrderPaidEvent(order));

            //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
7 years ago
Although making the change here should work, I question why OrderTotal is 0.00.  I've not yet looked at the code, but it would seem as if the gift card is treated as a discount, rather than a payment method, and that just does not seem right... IMHO, the OrderTotal should reflect the $ amount of items in the cart.
7 years ago
New York wrote:
Although making the change here should work, I question why OrderTotal is 0.00.  I've not yet looked at the code, but it would seem as if the gift card is treated as a discount, rather than a payment method, and that just does not seem right... IMHO, the OrderTotal should reflect the $ amount of items in the cart.

After additional thought, I think I take it back.  From an accounting perspective, you would not want to count the income twice, so treating it like a 'discount' seems right.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.