I am just trying out Vendr and i am having a weird thing happen...
Order has a totalcount of 1 and the new property. Order2 has a count of 0 and no properties.. How is this possible?
Here is the code...
var store = CurrentPage.GetStore();
using (var uow = _unitOfWorkProvider.Create())
{
var order = _sessionManager.GetOrCreateCurrentOrder(store.Id)
.AsWritable(uow)
.SetProperty("t4estprop",new PropertyValue("test"))
.AddProduct(AddToCartModel.ProductReference, AddToCartModel.Quantity);
uow.Complete();
//var id = order.Id.ToString();
}
var order2 = _sessionManager.GetCurrentOrder(store.Id);
It’s because you haven’t saved the order after you’ve made the changes so the changes are reverted when the unit of work completes. You need to call orderService.SaveOrder(order); before you complete your uow.
Can't edit order - Weird
I am just trying out Vendr and i am having a weird thing happen...
Order has a totalcount of 1 and the new property. Order2 has a count of 0 and no properties.. How is this possible?
Here is the code...
Hi Kris,
It’s because you haven’t saved the order after you’ve made the changes so the changes are reverted when the unit of work completes. You need to call orderService.SaveOrder(order); before you complete your uow.
Matt
is working on a reply...