Developer forum

Forum » Development » Order to CSV using notification

Order to CSV using notification


Reply

Hi

I'm doing an attempt to put one order into an CSV file whenever the order is completed.

Now, what i have found out is that Dynamicweb.Notifications.eCommerce.Order.Steps.Completed will only give me the orderfields - correct ?

And if so, how to get the orderlines other than by reading the database using the OrderID ?

 

Do you have som sample code in VB ?

/Lars


Replies

 
Reply

You could use a StringBuilder to concatenate the cvs while you loop through the OrderLines collection. Another approach could be to use the RenderOrder method of the Dynamicweb.eCommerce.Frontend.Renderer class and merge the order with a template looking something like this:

 

OrderID;OrderShopID;OrderDate;OrderModified;[and so on...]

<!--@LoopStart(OrderLines)-->

<!--@Ecom:Order:OrderLine.OrderID-->;<!--@Ecom:Order:OrderLine.OrderShopID-->;<!--@Ecom:Order:OrderLine.OrderDate-->;<!--@Ecom:Order:OrderLine.OrderModified-->;[and so on...]

<!--@LoopEnd(OrderLines)-->

 

That would make your code a lot simpler.

 

You must be logged in to post in the forum