Creating an order and adding product lines .Net API - Getting started
I'm just a little confused as to the correct process and method calls for creating a new order with the .Net API. In my .Net user control I have the product node that I wish to add to the order.
I'm guessing I need to create a new order first.
Add the product to it with the appropriate quantity.
Could someone get me started with some sample code?
Indeed it will - if you try to do anything with the order it will be auto created. We will look into to create new good stuff to help you in the .NET API
Anyways. I have uploaded a new Tea Commerce 1.4.1.0 BETA and changed the GetOrder() method instead of creating the GetOrCreateOrder() method
The razor version of GetOrder was buggy as it actually where supposed to return a new order if none was present. Otherwise the HasOrder method would also be useless :)
You can just install the new package on top of the old.
After Kenn and Dan from the other post came back with one more bug we have refactored the bit of the API you all are using. I have uploaded a new BETA package. We refactored the whole create orderline part and there's now two new, and much more simple methods called "CreateOrderLine" and "CreateUniqueOrderLine". You will then have to check for the existense of the order line yourselves.
Creating an order and adding product lines .Net API - Getting started
I'm just a little confused as to the correct process and method calls for creating a new order with the .Net API.
In my .Net user control I have the product node that I wish to add to the order.
I'm guessing I need to create a new order first.
Add the product to it with the appropriate quantity.
Could someone get me started with some sample code?
Thanks,
Matt
Hi Matt,
This post might be the solution for you as well:
http://our.umbraco.org/projects/website-utilities/tea-commerce/tea-commerce-support/21941-NET-API-GetOrCreateOrderLine%28%29-does-not-add-an-order-line
/Rune
Hi Rune,
I did see that post when I checked to see if my question had already been asked.
The above code will return null if no order is present so I need to find out how to create a new order to begin with.
Cheers, Matt
Ah OK, I figured out that calling
will create a new order if one does not exist. :)
Indeed it will - if you try to do anything with the order it will be auto created. We will look into to create new good stuff to help you in the .NET API
Yes, I was just about to write that. BUT it will return you a useless jSon string, and not a working order. I will create a new Razor method called
With that you will get the current order or generate a new one.
/Rune
Yes, I was just about to write that. BUT it will return you a useless jSon string, and not a working order. I will create a new Razor method called
With that you will get the current order or generate a new one, and have that returned. It will never return null.
/Rune
Oups, double post.
Anyways. I have uploaded a new Tea Commerce 1.4.1.0 BETA and changed the GetOrder() method instead of creating the GetOrCreateOrder() method
The razor version of GetOrder was buggy as it actually where supposed to return a new order if none was present. Otherwise the HasOrder method would also be useless :)
You can just install the new package on top of the old.
/Rune
Cool,
And getting the orderlines is simple enough.
Cheers, Matt
Great to hear! Please mark the correct post as a solution :)
Hi guys,
I have uploaded a new beta fixing a few bugs with the above mentioned stuff.
/Rune
Seems I was adding product lines incorrectly and this is how it should be done.
Yes, that is the correct way, after we have updated the API!
/Rune
Hi Matt,
After Kenn and Dan from the other post came back with one more bug we have refactored the bit of the API you all are using. I have uploaded a new BETA package. We refactored the whole create orderline part and there's now two new, and much more simple methods called "CreateOrderLine" and "CreateUniqueOrderLine". You will then have to check for the existense of the order line yourselves.
Here an example for you:
Hope it helps. And sorry for the break.
Thanks for the great feedback. It's really valuable for us.
/Rune
Thanks for letting me know Rune.
is working on a reply...