Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Quick update:
I have successfully founded the way to add the line item discount:
lineItem.Discounts.Add(new LineItemDiscount { DiscountName = SimulatedLineItemDiscountName, // @SimulatedDiscount:ValueBased DiscountAmount = discountValue, DiscountValue = discountValue });
It stores in database and works with CartValidate and CartPrepare workflows.
But I understood that the trick decribed early for form discounts doesnt work correctly. Form discount is removed from database after CartValidate workflow.
Looking for a solution.
As long as there is an @ in the beginning of the name it should not remove the discount.
Actually its only partially true.
For instance, for line item discounts the part ":ValueBased" (":PercentageBased") is required.
For form discounts even if discount with name started with "@" it will be deleted because method RemoveGiftPromotionFromOrder from CalculateDiscountActivity removes discounts which are not connected with Episerver promotion. So what I did I imported whole Mediachase.Commerce.Workflow project and changed a little bit RemoveGiftPromotionFromOrder method to avoid removal of discount with specified name.
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:
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.