Try our conversational search powered by Generative AI!

Loading...
Applies to versions: 12.2-13
Other versions:
ARCHIVED This content is retired and no longer maintained. See the version selector for other versions of this topic.

CheckInventory activity [Legacy]

Recommended reading 

During checkout, activity flows check remaining item stock quantities and calculate cart totals. Episerver Commerce incorporates a check inventory activity into the activity flows. This activity checks the warehouse inventory when adding or changing a cart item. 

Classes in this topic are available in the following namespace:

  • Mediachase.Commerce.Workflow.Activities. Contains CheckInventoryActivity

How it works

The CartPrepare activity flow is run prior to rendering the page where the customer confirms the order. This flow performs the following tasks:

  • Determines if the item is available, based on the Active status and the item's start and end dates. If an item is not available, it is removed from the cart, and an error message appears on the Cart view page.
  • Determines if cart items are still available based on remaining stock in inventory, reserved inventory stock, and whether backordering is permitted. If the item is not available, it is removed, and an error message appears on the Cart view page.
  • Calculates the price of each cart item, based on tiered pricing. If pricing has changed, a message regarding the change is returned and can be displayed to the customer.
  • Calculates a cart item's extended price, for instance multiplying the price by the quantity purchased.
  • Calculates discounts that apply to cart items.
  • If multiple shipments are created, splits line items into respective shipping addresses.
  • Adds shipping costs and applicable taxes to the cart.

The CheckInventoryActivity determines whether cart items are available.

Customizing the CheckInventory activity

To customize the inventory checking activity, create an activity flow that mirrors the CartPrepareActivityFlow and replace the CheckInventoryActivity activity with your implementation.

Do you find this information helpful? Please log in to provide feedback.

Last updated: Apr 01, 2021

Recommended reading