I want to disable the inventory, because we don't need it. So in the commerce manager I've set the inventory tracking and inventory status to disable on a variation.
Whenever I try to order a project (reproduced this on the QuickSilver demo site (https://github.com/episerver/Quicksilver)) the Workflow engine returns me the warning:
Item "" has been removed from the cart because it is no longer available or there is not enough available quantity.
Whenever I set the Max Quantity setting on the variable to something higher then 0, it starts working. This was also confirmed when I debug activity: CheckInventoryActivity
The below method is called and eventually it will set the lineItemQty to 0 and the changeQtyReason.Add("by Max Quantity setting").
protected Decimal GetNewLineItemQty(LineItem lineItem, List changeQtyReason, Shipment shipment)
Decimal lineItemQty = shipment != null ? Shipment.GetLineItemQuantity(shipment, lineItem.LineItemId) : lineItem.Quantity;
if (lineItemQty < lineItem.MinQuantity)
lineItemQty = lineItem.MinQuantity;
changeQtyReason.Add("by Min Quantity setting");
else if (lineItemQty > lineItem.MaxQuantity)
lineItemQty = lineItem.MaxQuantity;
changeQtyReason.Add("by Max Quantity setting");
I would expect whenever I disable the inventory I would not set the Max Quantity on the variation?
The MinQuantity and MaxQuantity are for the minimum and maximum quantity of an item that a customer can buy in an order. Even if inventory tracking disabled, you might still want to limit those values.
Of course, if you don't want to be bound by Min/Max Quantity, you're free to modify the workflows for that.
Thanks for the confirmation Quan.
You are correct in that you might want to limit those values. If both are null/0, they should be ignored. When using catalog import from a PIM system, these values don't come by default. Having to treat them separatly somehow or removing inventory validation or adjustment because of them is annyoing and not intuitive. Especially when the default behaviour is to just remove line items from the cart if they are not set...