Where does the API function 'GetAllFinalizedOrdersForCustomer' get data from?
I'm having trouble updating some custom properties on order lines in finalized orders. Changing data in the database or in the finalized XML will not result in the function returning the correct data.
The only way I can get it to give the correct data, is if I delete the finalized XML and rebuild the entire site.
So I guess its a third cached XML file somewhere.
But if 'UpdateOrderLine' doesn't update the same data as 'GetAllFinalizedOrdersForCustomer' gets - whats the whole point of using those API functions? Well I guess the answer to that is that there's a difference between an order and a finalized order. But updating the data manually in the database doesn't do the trick either.
Is the order that you try to set in the TC.SetCurrenOrder a finalized order? If so - you can't do that. The current order can only be an order that is in the cart stage.
GetAllFinalizedOrdersForCustomer uses the order xml cache file to fetch data. So if the order data is not there it won't find it correctly using this method. Try and check of you have some properties on the order/order line that isnt allowed in xml which could break that the order xml cache updates.
THe XML file you are talking about is 'App_Data/teacommerce/finalized-order-xml-cache-1.xml' right?
So nothing can be done via the API to update a finalized order?
But the .NET API documentation is thin. A method list for different scenarios would be nice.
But i'll manange.
But you're saying that I can easily update properties on a finalized order using the .NET API?
E.g. TeaCommerce.Api.Services.OrderService.Instance.Get(shopId, orderId).Properties.Get("alias").Value = "newValue";
would update both database and cached xml file so that TC.GetAllFinalizedOrdersForCustomer() will get the updated property? Or are you saying I should completely stop using GetAllFinalizedOrdersForCustomer and the Razor API?
You can just use the .NET API to update the finalized order. So get the order using the OrderService and then change things and save the order. The xml cache is then updated. Then use TC to get the order xml. TC is meant for the frontend where the .NET api is for the bit more advanced setups :)
GetAllFinalizedOrdersForCustomer data source?
Where does the API function 'GetAllFinalizedOrdersForCustomer' get data from? I'm having trouble updating some custom properties on order lines in finalized orders. Changing data in the database or in the finalized XML will not result in the function returning the correct data. The only way I can get it to give the correct data, is if I delete the finalized XML and rebuild the entire site.
So I guess its a third cached XML file somewhere.
But if 'UpdateOrderLine' doesn't update the same data as 'GetAllFinalizedOrdersForCustomer' gets - whats the whole point of using those API functions? Well I guess the answer to that is that there's a difference between an order and a finalized order. But updating the data manually in the database doesn't do the trick either.
Please help :)
Wait, now that I think about it. 'UpdateOrderLine' does not update my order lines.
The out-commented code does update the database ofcourse. The API UpdateOrderLines does not.
I guess I have to override something. But what?
Is the order that you try to set in the TC.SetCurrenOrder a finalized order? If so - you can't do that. The current order can only be an order that is in the cart stage.
GetAllFinalizedOrdersForCustomer uses the order xml cache file to fetch data. So if the order data is not there it won't find it correctly using this method. Try and check of you have some properties on the order/order line that isnt allowed in xml which could break that the order xml cache updates.
Kind regards
Anders
Okay got it.
THe XML file you are talking about is 'App_Data/teacommerce/finalized-order-xml-cache-1.xml' right? So nothing can be done via the API to update a finalized order?
Don't use the Razor TC class. Use the .NET API directly. The TC is just a facade for the .NET API
Got it.
But the .NET API documentation is thin. A method list for different scenarios would be nice. But i'll manange.
But you're saying that I can easily update properties on a finalized order using the .NET API?
E.g.
TeaCommerce.Api.Services.OrderService.Instance.Get(shopId, orderId).Properties.Get("alias").Value = "newValue";
would update both database and cached xml file so thatTC.GetAllFinalizedOrdersForCustomer()
will get the updated property? Or are you saying I should completely stop using GetAllFinalizedOrdersForCustomer and the Razor API?You can just use the .NET API to update the finalized order. So get the order using the OrderService and then change things and save the order. The xml cache is then updated. Then use TC to get the order xml. TC is meant for the frontend where the .NET api is for the bit more advanced setups :)
Alright. Got it. Thanks alot.
is working on a reply...