We are currently building a commerce website and are using the Serializable Cart. I am trying to register the Id of the organization of a contact on the cart. I found a property on the cart "Organization", type nullable Guid. Looks great...
However after saving the ICart as PurchaseOrder: orderRepository.SaveAsPurchaseOrder(cart), the organizationId is nowhere to be found on the PurchaseOrder.After some decompiling I found out that the SaveAsPurchaseOrder copies the Organization property from the cart to the purchase order.Which eventually results in calling the setter on the Mediachase.Commerce.Orders.OrderGroup class. This property contains the following code:
return new Guid?();
return Guid.TryParse(this.OwnerOrg, out result) ? new Guid?(result) : new Guid?();
this.OwnerOrg = value.ToString();
this.OwnerOrg = (string) null;
I do not get the last line: setting the property to null again ...
Any ideas why, or how to store the current contact organizationId on the cart and propagating it to the PurchaseOrder?
I think that is a bug it should return after setting the value if the if statement. You can try setting the PurchaseOrder.OwnerOrg field directly after converting.