Developer forum

Forum » Development » Override prices on orderlines

Override prices on orderlines

Morten Snedker
Reply

When prices are saved to an orderline, roundings and calculations are performed by PriceInfo. To avoid these calculations and roundings, and to be in full control by setting the values explicitly, you now have the possibility of setting the AllowOverridePrices property of the Orderline object:

            Dynamicweb.eCommerce.Orders.OrderLine ol = new Dynamicweb.eCommerce.Orders.OrderLine("ORDERLINE10");
            ol.AllowOverridePrices = true;
            ol.Quantity = 10;
            ol.Price.PriceWithoutVAT = 13.47;
            ol.Price.PriceWithVAT = 15.15375;
            ol.Price.VATPercent = 12.5;
            ol.Save();


The AllowOverridePrices property is available from version 19.2.2.4.

PS: AllowOverridePrices also goes for the Order object.


Regards
Morten Snedker


Replies

 

You must be logged in to post in the forum