2

May I ask how to update orders status with Sitecore Commerce 8 powered by Commerce Server. Or in sitecore 7.2 if possible.

Based on the class Sitecore.Commerce.Connect.CommerceServer.Orders.Models.CommerceOrder class, we tried to save StatusCode as "InProcess" but it was not updated.

CartServiceProvider provider = new CartServiceProvider();  
var orderRequest = new SubmitVisitorOrderRequest(buyCart);  
var orderResult = orderService.SubmitVisitorOrder(orderRequest);  
var order = orderResult.Order as CommerceOrder;  
order.StatusCode =  "InProcess";  
provider.SaveCart(new SaveCartRequest(order));
Martin Davies
  • 4,436
  • 3
  • 19
  • 40
  • Please include some code demonstrating what you have already attempted to solve this question. People will be much more likely to help if you demonstrate you have done some research and attempted to solve the issue yourself. – Scott Simontis Apr 13 '15 at 20:29

1 Answers1

0

We have tried the code below but got an error. https://social.msdn.microsoft.com/Forums/en-US/a4e74c33-cf4f-4a1b-843c-acf2514db3f2/how-to-update-purchase-order-status?forum=commserver2009#44ff5a5e-b6af-4b82-aebe-1c53beff9f5c

We modified the code to update status as admin OrderSiteAgent orderAgent = new OrderSiteAgent("website", true, "");

Error : on line OrderManagementContext context = OrderManagementContext.Create(ordersAgent); There was a problem reading the site resources from the Commerce Server administration database for the site 'website'. Please check that resources exist for the site and that the process has permission to access the database. The InnerException contains more details.