London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
AI OnAI Off
London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
OK, I figured it out - it was pretty simple - we had in the shopping cart an article that didn't exist anymore. Always check the shopping cart content for things that has nothing to do with the current article. :-)
Evdin
Hello,
I will not get in too many useless details, but the problem is pretty simple - I'm adding an article (variant) to the shopping cart:
Guid contactId = PrincipalInfo.CurrentPrincipal.GetContactId(); ICart cart = this.orderRepository.LoadOrCreateCart<ICart>(contactId, "Default"); ILineItem? shoppingCartLineItem = cart.GetAllLineItems().FirstOrDefault(lineItem => lineItem.Code == currentArticle.Code); if (shoppingCartLineItem == null) { // we have to add the product to the shopping cart. shoppingCartLineItem = cart.CreateLineItem(currentArticle.Code, this.orderGroupFactory); shoppingCartLineItem.Quantity = quantity; cart.AddLineItem(shoppingCartLineItem); } else { decimal totalQuantity = quantity + shoppingCartLineItem.Quantity; IShipment shipment = cart.GetFirstShipment(); cart.UpdateLineItemQuantity(shipment, shoppingCartLineItem, quantity); } IDictionary<ILineItem, IList<ValidationIssue>> shoppingCartValidationResult = this.orderValidationService.ValidateOrder(cart);
When I validate the shopping cart, I get this error: `RemovedDueToCodeMissing` and I totally don't understand why - what am I missing - the stock is there, the current market and the price is there - everything is correctly setip but there is something that I'm missing and I don't understand what. Can you please give me some hints?
Thank you,
Evdin