November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
Nov 23, 2020
Dec 21, 2020
Closed, Fixed and tested
Fixed issue where OrderGroupFactory calculates shipping IDs incorrectly after upgrade.
For the multiple order forms in cart as the below code, the CreateShipment() are returning same ShipmentId (-2). See comments in code.
Code to reproduce:
var orderRepository = ServiceLocator.Current.GetInstance<IOrderRepository>();
var orderGroupFactory = ServiceLocator.Current.GetInstance<IOrderGroupFactory>();
var currentMarket = ServiceLocator.Current.GetInstance<ICurrentMarket>();
ICart cart = orderRepository.LoadOrCreateCart<ICart>(CustomerContext.Current.CurrentContactId, "Default", currentMarket);
if (cart != null)
cart = orderRepository.LoadOrCreateCart<ICart>(CustomerContext.Current.CurrentContactId, "Default", currentMarket);
cart.GetFirstForm().Shipments.Clear();
cart.GetFirstForm().Shipments.Add(orderGroupFactory.CreateShipment(cart)); // Expected shipmentId is -2, which it is
orderRepository.Save(cart);
cart = orderRepository.LoadOrCreateCart<ICart>(CustomerContext.Current.CurrentContactId, "Default", currentMarket);
cart.GetFirstForm().Shipments.Add(orderGroupFactory.CreateShipment(cart));
//Expected shipmentId is -3 which it is in 13.18.2, but in 13.26.0 this is assigned -2 which leaves us with two shipments with the same id
cart.GetFirstForm().Shipments.Add(orderGroupFactory.CreateShipment(cart));
// This shipment gets id -3 which is fine