Posted on 09/06/2016 14:47:00
Never mind the previous, I think I found it in CartCatch.OrderLineBuilder:
If ProductReserve.Enabled AndAlso ProductToPutInCart.Type <> ProductType.Service AndAlso ol.HasType({OrderLine.OrderLineType.Product, OrderLine.OrderLineType.PointProduct}) Then
Dim cartStock As Double = ProductReserve.GetReservedAmount(ol.ProductID, ol.ProductVariantID) + QuantityOrderLine
If ProductReserve.GetReserveMode = ProductReserve.ReserveMode.modeCheckout Then
' When products is reserved only in checkout step we should take into account is there such product exist in cart
cartStock += EcomCart.OrderLines.Where(Function(cartLine) cartLine.ProductID = ProductID AndAlso cartLine.ProductVariantID = VariantID).Select(Function(cartLine) cartLine.Quantity).FirstOrDefault()
End If
If ProductToPutInCart.UnitStock < cartStock Then
Return Nothing
End If
End If
The last few lines seem to skip adding the line when there's not enough stock, even though "Don't show products that are not in stock" is not set.
Is there a manual way to handle reordering? In our case we're using it not to reorder, but to enable editing of an order. We create a reorder command, keep track of the original ID and then let the user perform the checkout. On integration time we send the order contents but also send it the original ID. With the items that are out of stock removed, this no longer works.
Thanks,
Imar