November Happy Hour will be moved to Thursday December 5th.

Need to set the Max Quantity even when inventory is set disabled?

Vote:
 

Hi,

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");
      }
      if (!this.InventoryTrackingEnabled(OrderGroupActivityBase.GetEntryRowForLineItem(lineItem)))
        return lineItemQty;

I would expect whenever I disable the inventory I would not set the Max Quantity on the variation?

#157850
Sep 23, 2016 9:05
Vote:
 

Hi,

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.

Regards,

/Q

#157854
Sep 23, 2016 9:54
Vote:
 

Thanks for the confirmation Quan.

Patrick

#157855
Sep 23, 2016 9:57
Vote:
 

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...

#171695
Nov 15, 2016 12:16
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.