Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > How do I programmatically change the order status? View modes: 
User avatar
Member
Member
tim-federationmedia - 1/26/2011 8:31:29 PM
   
How do I programmatically change the order status?
Hi All,

I am using Kentico 5.0

I have a situation where if certain conditions are met by the customer I will need to change the status on an e-commerce order.

I need to do this from within one of the Cart step controls.

Can someone please point me in the right direction. I have tried a number of different things but I cannot get it to change.

Thankyou in advance :)


User avatar
Kentico Support
Kentico Support
kentico_radekm - 2/9/2011 8:57:10 AM
   
RE:How do I programmatically change the order status?
Hello.

OrderStatusID is property of OrderInfo object.

You can get OrderInfo object via CMS.Ecommerce.OrderInfoProvider.GetOrderInfo method according to orderID. You can use CMS.Ecommerce.ECommerceContext.CurrentShoppingCart.OrderId to return current orderID and pass it to GetOrderInfo method.

When you have proper OrderInfo object, you can set its OrderStatusID property and call CMS.CMSEcommerce.OrderInfoProvider.SetOrderInfo(OrderInfo) on that object.


Best Regards,
Radek Macalik