Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Kasper Skov 66 posts 346 karma points
    Oct 23, 2013 @ 11:19
    Kasper Skov
    0

    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.

  • Anders Burla 2560 posts 8256 karma points
    Oct 23, 2013 @ 11:21
    Anders Burla
    0

    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

  • Kasper Skov 66 posts 346 karma points
    Oct 23, 2013 @ 11:31
    Kasper Skov
    0

    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?

  • Anders Burla 2560 posts 8256 karma points
    Oct 23, 2013 @ 11:58
    Anders Burla
    100

    DateFinalized != null is what specifies if its finalized. But other data has been changed as well when its finalized.

  • Kasper Skov 66 posts 346 karma points
    Oct 23, 2013 @ 12:16
    Kasper Skov
    0

    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.

  • Anders Burla 2560 posts 8256 karma points
    Oct 23, 2013 @ 12:29
    Anders Burla
    0

    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.

  • Kasper Skov 66 posts 346 karma points
    Oct 23, 2013 @ 13:03
    Kasper Skov
    0

    Yes to both.

    enter image description here enter image description here

  • Anders Burla 2560 posts 8256 karma points
    Oct 23, 2013 @ 13:11
    Anders Burla
    0

    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?

  • Kasper Skov 66 posts 346 karma points
    Oct 23, 2013 @ 13:21
    Kasper Skov
    0

    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?

  • Anders Burla 2560 posts 8256 karma points
    Oct 23, 2013 @ 13:23
    Anders Burla
    0

    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.

  • Kasper Skov 66 posts 346 karma points
    Oct 23, 2013 @ 13:33
    Kasper Skov
    0

    Okay I deleted it. But a new XML is NOT created when I navigate to the orders section of Tea Commerce??? :S

  • Anders Burla 2560 posts 8256 karma points
    Oct 23, 2013 @ 13:47
    Anders Burla
    1

    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.

  • Kasper Skov 66 posts 346 karma points
    Oct 23, 2013 @ 13:58
    Kasper Skov
    0

    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.

  • Kasper Skov 66 posts 346 karma points
    Oct 23, 2013 @ 14:57
    Kasper Skov
    0

    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?

  • Anders Burla 2560 posts 8256 karma points
    Oct 23, 2013 @ 15:04
    Anders Burla
    0

    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 :)

  • Kasper Skov 66 posts 346 karma points
    Oct 23, 2013 @ 15:07
    Kasper Skov
    0

    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.

Please Sign in or register to post replies

Write your reply to:

Draft