Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
So I have the following code working, and I can set the status of all the orders in an invoice to Unfullfilled/Fulfilled etc.. However, I was curious why, if I don't "raise events", the label does NOT get updated on sales listings? I'm more just curious what's going on under the hood here as I don't want anything "handled for me" if that makes sense. Plus our clients process is super unique, and it simply can't fit inside Merchello's shipping paradigm. But I do plan on using the status collections!
Anywho, below code will move it in the Sales Collections. But the label is not updated. Are they really separate somehow?
public void SetInvoiceOrdersToUnfulfilled(string invoiceKey)
var invoiceService = MerchelloContext.Current.Services.InvoiceService;
var orderService = MerchelloContext.Current.Services.OrderService;
var invoice = invoiceService.GetByKey(new Guid(invoiceKey));
IEnumerable<IOrder> orders = orderService.GetOrdersByInvoiceKey(new Guid(invoiceKey));
foreach (IOrder order in orders)
IOrderStatus orderStatus = orderService.GetOrderStatusByKey(Constants.OrderStatus.NotFulfilled);
order.OrderStatus = orderStatus;
orderService.Save(order, false); // sales listing table will still show "Fullfilled" if I set this to false..
I'm just confused why the label wouldn't update without additional events being fired.. Or what is happening under the hood in the event that forces the label to update (why is it separate?). Screenshot!
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted