Hi
For our customer we are trying to create a cart with discount codebehind.
We recieve a list with products from another solution and try to create a cart with it.
It works with the samplecode below:
Dim newOrder As Order = Order.Create("") newOrder.ShopID = "SHOP1" newOrder.LanguageID = "LANG1" newOrder.DowngradeToCart() Dim newProd As Product = Product.Create("PROD2652") Dim ol As New Dynamicweb.eCommerce.Orders.OrderLine(newProd) ol.Order = newOrder ol.Quantity = 1 ol.Product = newProd ol.SetUnitPrice(newProd.Price.Price) ol.Type = Dynamicweb.Base.ChkNumber(Dynamicweb.eCommerce.Orders.OrderLine.OrderLineType.Product).ToString() newOrder.OrderLines.Add(ol, True) newOrder.Save()
The cart looks the same as when adding the product to the cart on the frontend.
The only difference is, that there is no discount added.
In this case we added a 10% discount on the complete order. Adding the product frontend creates the discount, adding the product codebehind does not add the discount.
Is there a function to call, so the discount will be added as well when adding the product codebehind?
Gr
Martijn