Developer forum

Forum » Integration » Integration: export orders - OrderTotalPrice is always 0

Integration: export orders - OrderTotalPrice is always 0

Davy Capiau
Reply

Hi,

We're using the default Export Orders functionality in DW9.16.3 to generate the order XML.

Problem:
When exporting ordes with Price Discount rules applied, there is no 'price before discount' in the XML. I assume the value should be in the OrderTotalPrice node, but it's always '0'

In the screenshot below you can see the price after discount in OrderPriceWithVat and OrderPriceWithourVAT.

Extra:

The OrderTotalPrice node is always 0, also when exporting non-discount orders.


Replies

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

Hi Davy,

It is a basic SELECT * FROM EcomOrders, so all columns are extracted for the DataReader used to produce data for the XML. OrderTotalPrice is obsolete and is only there for the purpose of backwards compatibility. So you should just desregard it.

There is no column that holds the value "price before discount", so you will have to do that arithmetic yourself based on the available data. So for discounts you should have a OrderTotalDiscountWithVAT (and OrderTotalDiscountWithoutVAT). Take into account you also have a OrderPriceBeforeFeesWithVAT that may need to be considered in relation to discounts. You may freely create a new order field, and by calculation on your template you apply the desired calculated value and add it to the custom order field. Then that value will automatically be in the order XML as well.

Let me know if the above explanation was helpful.
 

BR
Snedker

Votes for this answer: 1

 

You must be logged in to post in the forum