Hi.
Some background: In some cases I need to call a third-party service which sends entry/order/shipment level discounts (there are not related to any promotions in the system) and then I need to apply these values.
I reviewed RemoveDiscountsActivity and CalculateDiscountsActivity and did the following trick to apply form discount:
foreach (var orderForm in _cartHelper.Cart.OrderForms.ToArray()) { orderForm.Discounts.Add(new OrderFormDiscount { DiscountName = SimulatedDiscountName, // @SimulatedDiscount DiscountValue = discountValue }); }
But the same trick doesnt work for line item discounts. And for shipments discounts I didnt even try.
Maybe someone can help me with it or suggest the better solution.
Thanks.