So after I add a GiftCard to the Cart, I then use either a 100% Discount or Points to pay for it. Ideally I would assume that the system does NOT take me to PayPal (since skipPaymentWorkflow = true) but that the system does send the email with the Coupon to the person I selected.
The system does not send you to PayPal and the recipient of gift card is notified about his "gift" you purchased for him. It works this way. I haven't got what exactly is wrong?
The condition is "skipPaymentWorkflow = true" Let's say I paid with a 100% discount coupon.
Around line 1000, there is a: if (sc.ProductVariant.IsGiftCard) { where the code creates an entry on the GiftCard table "_giftCardService.InsertGiftCard(gc);" }
This piece of code creates an entry with IsGiftCardActivated = false, IsRecipientNotified = false,
...but I do NOT see any call to the _workflowMessageService.SendGiftCardNotification(gc, order.CustomerLanguageId);
So my question is WHEN does the card emails the recipient?
for (int i = 0; i < opv.Quantity; i++) { var gc = new GiftCard() { GiftCardType = opv.ProductVariant.GiftCardType, PurchasedWithOrderProductVariant = newOpv, Amount = opv.UnitPriceExclTax,
// SDSHARP if (skipPaymentWorkflow) _workflowMessageService.SendGiftCardNotification(gc, order.CustomerLanguageId); }
I normally mark "// SDHARP" ...where I make changes so that i can update on newer versions if I need to The same fix was done in 2 places where it says:
1) //gift cards if (sc.ProductVariant.IsGiftCard)
...and also 2) //gift cards if (opv.ProductVariant.IsGiftCard)
and off course, you should look also at the POST PAYMENT event for example, on my case I use PayPal and there is NO code that sends the email and sets it as Activated
I've just tested it one more time. And everything works fine!
A recipient is notified about a gift and a call to the _workflowMessageService.SendGiftCardNotification() is also made (from OrderProcessingService.SetOrderStatus() method) . Just ensure that "Gift card activation order status" is set to "Complete" on the order settings page (admin area). In this case a recipient will be automatically notified about any gift card purchased for him once order status is set to "complete" (and it's set to "complete" if you order total is 0 and there's no any shippable products)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.