I'm currently looking into Quicksilver and I see that during Checkout AdjustInventory is called on the cart.
However, after completing Checkout, the inventory stays the inventory of the SKU stays the same and is not diminished by the quantity.
Any idea on how to do this in code during Checkout?
Thanks in advance!
If inventory tracking is enabled, the SKU inventory should be adjusted after purchase. Can you check is it enabled?
Yeah, it is.
Could you try setting the InventoryTrackingStatus on the line item to InventoryTrackingStatus.Enabled?
lineItem.InventoryTrackingStatus = InventoryTrackingStatus.Enabled
To determine if the tracking status should be active, you can get the tracking status from the SKU.
No, this was not it. Any other ideas?
I think you could debug on Quicksilver and show your data. I think the issue was in CheckoutService > ValidateOrderOperation.
If not, it should go to CartService > RequestInventory, show us the validationIssues
Please show us what issue you got.
I believe that the WarehouseCode on the shipment must be set as well.
Note that when you look at the Inventories view in Catalog UI
InStock is actually [PurchaseAvailableQuantity] + [PurchaseRequestedQuantity]. (I'm not saying it's a good UI decision, I'm just saying it's the way it is right now).
So if you ordered 5 of item above, [PurchaseRequestedQuantity] will be set to 5, PurchaseAvailableQuantity is -5, but the InStock remains the same.
Until you release the shipment, which actually commits PurchaseRequestedQuantity, then InStock will remain the same.
EDIT: the above is not true, at least with latest version