volume_up
A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More.
A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More.
Hi Khan,
The coupon code does exist for the save PO in OrderFormEx.
SELECT * FROM OrderFormEx where Epi_CouponCodes IS NOT NULL
So we can retrieve the PO + Coupon Codes with this way:
var pos = _orderRepository.Load<IPurchaseOrder>(CustomerContext.Current.CurrentContactId);
var couponsWithOrders = new Dictionary<string, string>();
foreach (var po in pos)
{
List<string> couponList = new List<string>();
foreach (var form in po.Forms)
{
couponList.AddRange(form.CouponCodes);
}
couponsWithOrders.Add(po.OrderNumber, string.Join(",", couponList.Select(x=>x)?.ToList()));
}
I am quite sure this is one of the recipe in my second book that you purchased :)
:)
It was the very custom thing I guess,
IContentLoader, IPromotionService and PromotionInformationRepository helped, but I had to record Coupon Usages my self
How Can I retrieve the following Information about coupons/vouchers?
Coupons have been redeemed.
Order Number where the coupon was redeemed.
I am on Latest Commerce Version.