Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Stock not updating in CartCheckout workflow

Vote:
 

In our project we're experiencing that the stock quantity on the SKU isn't updating when a customer places an order.

We only have one warehouse, which is set as available, primary, fulfillment center and pickup location.

The validation of the stock quantity in the ValidateCart workflow works as expected, the customer isn't able to buy the SKU if the stock is 0, or more than the stock quantity if it's above zero.

Both inventory status and tracking are enabled. The CartCheckout workflow is running and the AdjustInventory activity is enabled in the workflow.

The stock quantity isn't updated in any environments, including locally.

Does anyone have a suggestion on what might be the issue?

#121476
May 12, 2015 9:17
Vote:
 

Hi,

Which version are you using?

Prior to Commerce 8.8, there're some limitations with inventory system and I would recommend to upgrade to Commerce 8.8, or later version, for better and smarter inventory system.

The stock adjustment is made in the AdjustInventoryActivity, you might grab our Workflow project, build it and debug to see what happens in that activity.

Regards.

/Q

#121503
May 12, 2015 14:50
Vote:
 

Hi Quan,

Thanks for the reply!

We're using Commerce 8.9.0.566 and CMS 8.1.0.0.

I'll try what you're suggesting.

Lars

#121504
May 12, 2015 15:02
Vote:
 

Hi,

By debugging the AdjustInventoryActivity I found that the OperationKeysMap on the shipments always contains 0 elements, event though the shipment contains several LineItemIndexes. When is OperationKeysMap supposed to be populated?

Lars

#121611
May 15, 2015 9:26
Vote:
 

Hi,

In RequestInventory method of AdjustInventoryActivity (aka when user places an order), we make request to the inventory system and then store return data in shipment.OperationKeys. Those data will be used to commit the changes when you complete the shipment, or revert the changes if you cancel it. Those behaviors are documented here: http://world.episerver.com/documentation/Items/Developers-Guide/EPiServer-Commerce/8/Warehouses-and-inventories/inventory-requests/

Do you have a custom workflow project, or are you using our default workflow?

Regards,

/Q

#121612
May 15, 2015 9:38
Vote:
 

Hi,

We're using the default workflow.

When we debug the AdjustInventoryActivity the RequestInventory method is never called - it seems like the activity is only run when the request type is Complete.

Lars

#121616
May 15, 2015 10:28
Vote:
 

It's also called in this condition

else if (orderGroupStatus == OrderStatus.InProgress || orderGroupStatus == OrderStatus.AwaitingExchange)
                        {
                            // When placing an order or creating an exchange order
                            bool placingOrder = shipmentStatus == OrderShipmentStatus.AwaitingInventory || shipmentStatus == OrderShipmentStatus.InventoryAssigned;
                            if (placingOrder)

So make sure your order and shipment have correct status.

Regards.

/Q

#121617
May 15, 2015 10:32
Vote:
 

Hi,

We finally found out what the error was!

In out project we're skipping the "Awaiting Inventory" status on the shipments and setting them to "Released" programmatically. We were doing this before the CartCheckoutWorkflow was run, so in the AdjustInventoryActivity the third condition (orderGroupStatus == OrderStatus.InProgress || orderGroupStatus == OrderStatus.AwaitingExchange) was never reached. We're now changing the shipment status after the CartCheckoutWorkflow has run.

Thank you for your help Quan!

Lars

#121623
May 15, 2015 13:21
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.