Posted on 01/02/2022 15:08:52
Hi Anders,
The value of [EcomOrders].[OrderPriceCalculationDate] (Order.PriceCalculationDate) is always null if you have not used the OrderTime parameter. We only change the value when you use the OrderTime parameter in a request (form, query or cookie). Once the value has been set it will be used for all future calculations - until it is changed again by using the OrderTime parameter.
If the calculation date was changed then the order log should contain entries like the following:
Tue, 01 Feb 2022 14:56:19 Order Setting order time to 02-02-2022 00:00:00
Tue, 01 Feb 2022 14:56:19 Order Getting order from Context.Cart: CART123 (IsCart:True, UserID/name/secondaryid:0//0, Complete:False), (IP:127.0.0.1, Url:/Default.aspx?ID=3&OrderTime=2022-02-02)
When Order.PriceCalculationDate is null we will use the current time (DateTime.Now) in price calculations.
But it seems that you experience a different behavior where the value is being set unexpectedly, since you don't use the OrderTime parameter. I was unable to reproduce that.
Do you have any extension, live integration or import that might be changing the value of either Context.OrderTime, Order.PriceCalculationDate or [EcomOrders].[OrderPriceCalculationDate]?
Best regards,
Morten