I'm building my own lists of orders with various status codes. History, active orders, subscriptions and stuff like that.
What criteria does an order have to fulfill to be returned from the function 'GetAllFinalizedOrdersForCustomer'? Im not getting any results even though I have completed orders.
The order must be linked to the customer id that you specifiy for the method. Tea Commerce automatic set the customer id of an order if a member is logged in. If you create a member when the order is finalized then you need to set the customer id your self. order.CustomerId = id; order.Save();
Well the function isn't returning any results with (correct) parameters storeId and customerId.
I'm building my own data context to retrieve the data. Too bad, cause I liked the idea that you could easily access custom order properties, order lines etc. with 'GetAllFinalizedOrdersForCustomer()'
Delete it. Then go to the order admin of Tea Commerce which should generate it again. If still only one order, then there might be an illigal char in some of your properties that isnt allowed in xml and because of that cant generate the file with all orders.
Ahh sorry. You need to load a page that use the GetFinalizedOrders or GetFinalizedOrdersForCutomer. That will try and recreate. If still only one order. Then see the App_Data/Logs and see what the exception is.
Yep that generated a new XML that looks intact.
And I'm getting results from the function.
So what's the conclusion? The xml file just needed a "reset"? I wonder how it went wrong/corrupt.
Thanks for your help Anders. Saved me some time from building a linq class and writing the queries to obtain custom properties etc.
Yes you can change the order line - BUT the stock level isnt changed for the product after the order is finalized. We are looking into fixing that - but its not that simple :)
Criteria for finalized order?
I'm building my own lists of orders with various status codes. History, active orders, subscriptions and stuff like that.
What criteria does an order have to fulfill to be returned from the function 'GetAllFinalizedOrdersForCustomer'? Im not getting any results even though I have completed orders.
The order must be linked to the customer id that you specifiy for the method. Tea Commerce automatic set the customer id of an order if a member is logged in. If you create a member when the order is finalized then you need to set the customer id your self. order.CustomerId = id; order.Save();
Hope that helps
No that doesn't help. I'm asking what an order has to have, for it to be 'finalized'. A specific orderStatsId or maybe DateFinalized != null?
DateFinalized != null is what specifies if its finalized. But other data has been changed as well when its finalized.
Alright cool.
Well the function isn't returning any results with (correct) parameters storeId and customerId. I'm building my own data context to retrieve the data. Too bad, cause I liked the idea that you could easily access custom order properties, order lines etc. with 'GetAllFinalizedOrdersForCustomer()'
Thanks for your time Anders.
Have TC 2.2 installed?
Have you checked that the customer id is saved for the order in the DB? If it is - it should work.
Yes to both.
We fixed a bug in 2.1.1 that should correct this. Can you check if an xml file is generated in App_Data/tea-commerce?
Alright yeah. There's an xml file. But it only contains a single order. And its not the order I'm looking for in above picture.
What now?
Delete it. Then go to the order admin of Tea Commerce which should generate it again. If still only one order, then there might be an illigal char in some of your properties that isnt allowed in xml and because of that cant generate the file with all orders.
Okay I deleted it. But a new XML is NOT created when I navigate to the orders section of Tea Commerce??? :S
Ahh sorry. You need to load a page that use the GetFinalizedOrders or GetFinalizedOrdersForCutomer. That will try and recreate. If still only one order. Then see the App_Data/Logs and see what the exception is.
Ah okay.
Yep that generated a new XML that looks intact. And I'm getting results from the function. So what's the conclusion? The xml file just needed a "reset"? I wonder how it went wrong/corrupt.
Thanks for your help Anders. Saved me some time from building a linq class and writing the queries to obtain custom properties etc.
Another quick question Anders.
Does API allow me to update order lines once it's finalized? If not, do you have suggestion on a quick and dirty way to do it via the API?
Yes you can change the order line - BUT the stock level isnt changed for the product after the order is finalized. We are looking into fixing that - but its not that simple :)
Alright. I tried changing some custom properties. I didn't seem to work. I'll have a closer look and maybe write my own logic.
is working on a reply...