If a customer selects a SKU that is out of stock (i.e., stockLevel, backorderLevel, and preorderLevel are all 0), the label on the Add to Cart button changes to Email Me When In Stock. If the customer clicks this link, a popup window prompts for an email address to send a notification to when the item is back in stock:

If the customer fills in an email address and clicks the Submit button, a repository item of type backInStockNotifyItem is created in the profile repository. This item holds the email address plus the product ID and SKU ID of the out-of-stock item.

The CRS Store.Fulfillment module adds a Patch Bay message sink class, atg.projects.store.inventory.BackInStockNotificationService, to the standard Fulfillment system. A component of this class, /atg/store/inventory/BackInStockNotificationService, listens for JMS messages of type UpdateInventory. This message type, which is typically sent by an external inventory system, informs the Fulfillment system about formerly unavailable products and SKUs that stock is now available for. (See the ATG Programming Guide for information about Patch Bay.)

When an UpdateInventory message is received, BackInStockNotificationService examines the backInStockNotifyItem repository items. If a backInStockNotifyItem contains the product ID or SKU ID of one of the products or SKUs listed in the UpdateInventory message, BackInStockNotificationService sends a Back in Stock email message to the address stored in the backInStockNotifyItem, and then deletes the backInStockNotifyItem.

 
loading table of contents...