Not sure which "lineitem price" that you means, because lineitem has PlacedPrice which is basically the price per unit before discounts, and ExtendedPrice which is price for all unit (for example you are buying 3) after discounts. ExtendedPrice should be changed. If you want to get the new total, you would need to calculate it again because the total might have changed (therefore taxes etc).
Hi Quan,
When adding a coupon, applying it and saving the cart no discount is being applied. Looking at the seralized cart lineitems only shows PlacedPrice (price per unit before discount), there is no extended price.
Furthermore running cart.GetOrderDiscountTotal brings back zero too. And running cart.UpdatePlacedPriceOrRemoveLineItems also makes no difference.
Before the new promotions engine all we had to do was:
MarketingContext.Current.AddCouponToMarketingContext(couponCode);
And then run the workflows and everything would be handled for us. Now this doesn't seem possible.
When you run the workflows it is equivalent to .ApplyDiscount + Calculate, so to get the same result you need to Calculate as well.
Do you make sure that the promotion is ready and all other conditions have been statisfied ?
Hi Quan,
As you can see in the code we do actually check if the promotion has been fulfilled and this comes back as true.
The Promotion is active and gets applied. What is interesting is on cart.GetFirstForm() you can see that the coupon code has been added, but within the Promotions collection there is nothing.
Commerce 11.8.2
Currently using out of the box promotions. We have an "Apply Promotion Code" input at the basket level.
Looking at the code in Quicksilver we are doing this:
We get no exceptions when doing this and it runs through, but what we're not seeing is any change in lineitems price or total cart price. I can't see what is different between what we're doing and whats in the reference project.
Can anyone shed any light on how to apply promotions on a cart and show the relevent discounted price.