Class Name |
|
---|---|
Component(s) |
|
The InventoryLookup
servlet bean returns inventory information for a specified item.
Input Parameters
itemId (Required)
The catalogRefId
of the product catalog SKU whose inventory information will be retrieved.
locationId
The ID of the location used for inventory lookups.
useCache
If set to true, cached inventory data will be retrieved. Depending on how the inventory is updated, cached data may be out of date. For general store browsing where performance is critical, useCache
should be set to true. If it is essential that the retrieved inventory information match the latest information in the repository, then set useCache
to false.
Output Parameters
inventoryInfo
The information object that holds the retrieved inventory information. The inventoryInfo
object has the following properties:
availabilityStatus
: The numerical availability statusavailabilityStatusMsg
: A string that maps to the numericalavailabilityStatus
as follows:1000: INSTOCK
1001: OUTOFSTOCK
1002: PREORDERABLE
1003: BACKORDERABLE
availabilityDate
: The date on which the item will become available.stockLevel
: The total number of units currently in stock.preorderLevel
: The total number of units that are available for preorder.backorderLevel
: The total number of units that are available for backorder.stockThreshold
: The threshold for the stock level.preorderThreshold
: The threshold for the preorder level.backorderThreshold
: The threshold for the backorder level.
error
Any exception that may have occurred while looking up the inventory information.
Open Parameters
output
The open parameter rendered if the inventory information is successfully retrieved.
Example
The following code sample is an example of using the InventoryLookup
servlet bean:
<dsp:droplet name="/atg/commerce/inventory/InventoryLookup"> </td> <dsp:param param="link.item.repositoryId" name="itemId"/> <dsp:param value="true" name="useCache"/> <dsp:oparam name="output"> This item is <dsp:valueof param="inventoryInfo.availabilityStatusMsg"/><br> There are <dsp:valueof param="inventoryInfo.stockLevel"/> left in the inventory.<br> </dsp:oparam> </dsp:droplet>