How you manage inventory in your site depends largely on how you want to respond to a situation in which a given item is out of stock. In such a situation, you can either place the item on backorder, or you can notify the customer that the item is not currently available.
The FlagInventory and LocalInventory components, which have an affinity with the Inventory stage, coordinate with the QueryProdInfoADO component (Product Information stage) to support either response.
The FlagInventory component is designed to identify items in the items SimpleList that are out of stock. When this component runs, it iterates through the items in the items SimpleList to verify that the _product
_in
_stock
name/value pair for a given item is not zero (0).
If the _product
_in
_stock
name/value pair evaluates to zero (0), FlagInventory can respond in either of several ways. The component supports a Disallow Backorder property, which you set using the component's property page. If the Disallow Backorder check box is selected, and evaluates to 0, FlagInventory adds a _pur
_out
_of
_stock
message to the _Purchase
_Errors
SimpleList. If Disallow Backorder is not selected, and _product
_in
_stock
evaluates to zero (0), then the _inventory
_backorder
name/value pair for the affected item is set to zero (0).
Note If you include the FlagInventory component in your pipeline, but do not design the query that you execute in the Product Information stage to reference the in
_stock
column in your product table, the component fails.
The LocalInventory component compares the number of units in the Quantity
name/value pair to the number in the _product
_local
_inventory
name/value pair. The _product
_local
_inventory
value pair should represent the actual number of items in stock. If the Quantity
exceeds _product
_local
_inventory
, the difference between these two numbers is written to the _inventory
_backorder
name/value pair, provided that LocalInventory is configured to allow backordering. Otherwise, LocalInventory, like FlagInventory, writes a _pur
_out
_of
_stock
message to the _Purchase
_Errors
SimpleList.
If you include the LocalInventory component in your site's pipeline, the script that you use to display the basket to customers should be written to notify them that a requested item is either out of stock or on backorder.
Note If you include the LocalInventory component in your pipeline, but do not design your Product Information query to reference the local
_inventory
column in your product table, LocalInventory fails.