Hi Dynamicweb,
We have two shops in the same solution, where we need different stock checks; one should reserve when items are added to basket and you are not allowed to order more than we have in stock. I the other shop you can as many items as you want no matter what is in stock.
So in the OrderLineService: OrderLineBuilder I hope that you can add a new notifier where I can overrule the variable: doCheckStock? The notifier should have the value for doCheckStock and the current product to be added to the cart.
' Check stock and reserve Dim doCheckStock As Boolean = Converter.ToBoolean(SystemConfiguration.Instance.GetValue("/Globalsettings/Ecom/Product/DontShowProductIfNotOnStock")) If ProductReserve.Enabled AndAlso doCheckStock AndAlso productToPutInCart.Type <> ProductType.Service AndAlso productToPutInCart.Type <> ProductType.GiftCard AndAlso theOrderLine.HasType({OrderLineType.Product, OrderLineType.PointProduct}) Then Dim cartStock As Double = ProductReserve.GetReservedAmount(theOrderLine.ProductId, theOrderLine.ProductVariantId) + quantityOrderLine If ProductReserve.Mode = ProductReserveMode.Checkout Then ' When products is reserved only in checkout step we should take into account is there such product exist in cart cartStock += order.OrderLines. Where(Function(cartLine) Not String.IsNullOrEmpty(cartLine.ProductId) AndAlso cartLine.ProductId.Equals(productId, StringComparison.OrdinalIgnoreCase) AndAlso ((String.IsNullOrEmpty(cartLine.ProductVariantId) AndAlso String.IsNullOrEmpty(variantId)) OrElse cartLine.ProductVariantId.Equals(variantId, StringComparison.OrdinalIgnoreCase))). Select(Function(cartLine) cartLine.Quantity).FirstOrDefault() End If If productToPutInCart.UnitStock < cartStock Then Return Nothing End If End If
Please add this in a near hotfix :-)
Best regards, Anders