Copied to clipboard

Flag this post as spam?

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


  • Merijn van Mourik 58 posts 128 karma points
    Apr 25, 2013 @ 18:55
    Merijn van Mourik
    0

    Finalizing order

    Hi,

    Small question about the .NET Api for TeaCommerce 2.0

    I have a process where I want after the order is finalized, but before the confirmation mail is sent, I call a webservice, and place the result in the confirmation mail. It is important the order is payed for.

    My first idea is just update one of the Order properties with TC.AddOrUpdateOrderProperty. And put that code in one of the events Order_OrderFinalizing or Order_OrderFinalized. However is changing order properties at that place ok?

    Merijn

  • Anders Burla 2560 posts 8256 karma points
    Apr 25, 2013 @ 19:32
    Anders Burla
    100

    If you use the OrderFinalized then you cant use TC.AddOrUpdateOrderProperty as TC is customer session specific and the order finalized is most called fomr a server to server callback from the payment gateway. Just use the order.Properties.AddOrUpdate method and then save the order. If you use the OrderFinalizing then you don't need to save the order - BUT the OrderFinalizing is called just before the order is saved and if you change properties, then the event for order properties wont be executed. Events are only called ones per order save cycle.

    Kind regards
    Anders

  • Merijn van Mourik 58 posts 128 karma points
    Apr 25, 2013 @ 21:48
    Merijn van Mourik
    0

    Hi Anders,

    The OrderFinalized seems to work... but not always. Sometimes the property is not saved. I do call the order.Save() explicitly.

    I doublechecked, the webservicecall returns the required content. I looked also in finalized-orders-xml-cache-1.xml file. Property is not visible there either.

    Any idea?

    Cheers,

    Merijn

  • Anders Burla 2560 posts 8256 karma points
    Apr 26, 2013 @ 16:08
    Anders Burla
    0

    Are you running Tea Commerce 2.0.0? There is a bug with the database fields for CustomOrderProperty and CustomOrderLineProperty - they are nvarchar(255) and should be ntext. It will be fixed in 2.0.1

    Kind regards
    Anders

  • Merijn van Mourik 58 posts 128 karma points
    May 02, 2013 @ 15:40
    Merijn van Mourik
    0

    Were at 2.0.0. Currently running 2.1.1.

    I guess I get what's happening here... it looks like if I'm in the Order_OrderFinalizing or Order_OrderFinalized and do TC.AddOrUpdateOrderProperty. A new cart item is created and the properties are set on the next order.... I doublechecked again by reading this post carefully.

    Now I see where I went wrong. I should have used order.Properties.AddOrUpdate. Next time I will try more patience and read better.

    Btw: documentation portal: great stuff over there!!!

     

Please Sign in or register to post replies

Write your reply to:

Draft