Developer forum

Forum » Development » When is ORDERPRICECALCULATIONDATE set?

When is ORDERPRICECALCULATIONDATE set?

Anders Ebdrup
Anders Ebdrup
Reply

Dear Dynamicweb,

 

We see some issues with not having the price calculated right on orders, where the field ORDERPRICECALCULATIONDATE is set in EcomOrders to a date in the past.

So when is this field set (And we are not posting an OrderTime in the request)? And how can we make sure that the date today is used for price calculations?

This issue is seen in 9.12 and not earlier versions of Dynamicweb.

 

Best regards,

Anders


Replies

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply
This post has been marked as an answer

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
Votes for this answer: 1
 
Anders Ebdrup
Anders Ebdrup
Reply

Dear Morten,

 

We can actually see that this issue is before the upgrade to 9.12, so after resetting the value in the database for each cart, then we haven't seen it since.

Thanks for a quick response here! :-)

 

Best regards, Anders

 

You must be logged in to post in the forum