diff --git a/13/umbraco-commerce/how-to-guides/limit-orderline-quantity.md b/13/umbraco-commerce/how-to-guides/limit-orderline-quantity.md index 41bc1edd17a..aa86e5e33a2 100644 --- a/13/umbraco-commerce/how-to-guides/limit-orderline-quantity.md +++ b/13/umbraco-commerce/how-to-guides/limit-orderline-quantity.md @@ -28,11 +28,9 @@ public class ProductAddValidationHandler : ValidationEventHandlerBase x.ProductReference == productReference).Sum(x => x.Quantity) ?? 0; - - if (stock.HasValue && totalQuantities >= stock.Value) + if (stock.HasValue && evt.Quantity > stock.Value) evt.Fail($"Only {stock} quantities can be purchased for {productReference}."); } } @@ -58,7 +56,7 @@ public class OrderLineQuantityValidationHandler : ValidationEventHandlerBase stock.Value) evt.Fail($"Only {stock} quantities can be purchased for {productReference}.");