Displaying available inventory on product display page Technote
(troubleshooting)Problem(Abstract) You want the product display pages to show the number of items currently in inventory. You need to know which beans are used to do this. Resolving the problem The beans use will depend on whether ATP is being used to track inventory.
Case 1: ATP is being used to track inventory
Inventory values can be found by using the InventoryJDBCHelperAccessBean bean. For details related to InventoryJDBCHelperAccessBean, consult the WebSphere Commerce Information Center:
http://publib.boulder.ibm.com/infocenter/wchelp/v6r0m0/index.jsp?topic=/com.ibm.commerce.api.doc/com/ibm/commerce/inventory/objects/InventoryJDBCHelperAccessBean.html
There are certain methods which are relevant here:
- Use the findAvailQuantityByItemFFCStore method to get the result of the following command:
SELECT qtyavailable FROM invstffmvw WHERE store_id=? AND itemspc_id=? AND ffmcenter_id=?
- The findItemInventoryListByStoreIdAndItemSpcId could also be used and has the same result set as the method findAvailQuantityByItemFFCStore.
select itemspc_id, qtyavailable, ffmcenter_id from invstffmvw where store_id = ? and itemspc_id = ? and ffmcenter_id = ?
- Use the findItemAvailableInventoryByStoreIdAndItemSpcId method to get a result of the following command:
select itemspc_id, qtyavailable, quantitymeasure from invstvw where store_id = ? and itemspc_id = ?
Notice that the quantity can come from either the invstffmvw or invstvw table. The difference is that invstffmvw is the existing quantity available for an item at a store and fulfilment center, while invstvw is the existing quantity available for an item for a given store across all fulfillment centers.
For more information on the invstffmvw data table, refer to the following page of the Information Center:
http://publib.boulder.ibm.com/infocenter/wchelp/v6r0m0/index.jsp?topic=/com.ibm.commerce.database.doc/database/invstffmvw.htm
For more information on the invstvw data table, refer to the following page of the Information Center:
http://publib.boulder.ibm.com/infocenter/wchelp/v6r0m0/index.jsp?topic=/com.ibm.commerce.database.doc/database/invstvw.htm
Case 2: ATP is not being used to track inventory
Inventory values can be found by using the InventoryAccessBean bean. For details related to InventoryAccessBean, consult the WebSphere Commerce Information Center:
http://publib.boulder.ibm.com/infocenter/wchelp/v6r0m0/index.jsp?topic=/com.ibm.commerce.api.doc/com/ibm/commerce/fulfillment/objects/InventoryAccessBean.html
Use findByCatalogEntryAndFulfillmentCenterAndStore to get the InventoryAccessBean bean representing the specified CatalogEntry in the context of a fulfilment center and a store.
SELECT * FROM INVENTORY T1 WHERE T1.CATENTRY_ID = ? and T1.FFMCENTER_ID = ? and T1.STORE_ID = ? FOR UPDATE
The getQuantity() method of the inventory access bean provides access to INVENTORY.QUANTITY.
Cross Reference information
Segment Product Component Platform Version Edition Commerce WebSphere Commerce Enterprise Customization / Application Development AIX, i5/OS, Linux, Solaris, Windows 6.0 Enterprise Commerce WebSphere Commerce Business Edition Customization / Application Development AIX, i5/OS, Linux, Solaris, Windows 5.6.1 Business Edition Commerce WebSphere Commerce - Express Customization / Application Development AIX, Linux, Solaris, Windows, i5/OS, OS/400 5.6.1, 6.0 Commerce WebSphere Commerce Developer Enterprise Customization / Application Development AIX, i5/OS, Linux, Solaris, Windows 6.0 Enterprise Commerce WebSphere Commerce Developer Business Edition Customization / Application Development AIX, i5/OS, Linux, Solaris, Windows 5.6.1 Developer Business Edition Commerce WebSphere Commerce Developer Professional Edition Customization / Application Development AIX, i5/OS, Linux, Solaris, Windows 5.6.1, 6.0 Developer Professional Edition Commerce WebSphere Commerce Developer Express Customization / Application Development AIX, i5/OS, Linux, Solaris, Windows 5.6.1, 6.0 Developer Express
Document Information Current web document: http://www.ibm.com/support/docview.wss?uid=swg21225158