/** * Check if inventory detail can be sent. * * @param Mage_Sales_Model_Quote_Item_Abstract * @return bool */ public function canSendInventoryDetail(Mage_Sales_Model_Quote_Item_Abstract $item) { // The session will have inventory details data stored only for managed stock items. // We need to make sure this item is managed stock before attempting to retrieve its // inventory details data from the session, or it will trigger a pointless call to ROM. return $this->_inventoryItemSelection->isStockManaged($item) && $this->isRequestedItemAvailable($item); }
/** * Check the inventory status of a quote item. Will add errors * to the quote and items if any are not currently available at the * requested quantity. Will throw an exception if any item not yet added * to the quote should be prevented from being added. * * @param Mage_Sales_Model_Quote_Item * @return self * @throws EbayEnterprise_Inventory_Exception_Quantity_Unavailable_Exception If any items should not be added to the quote. */ public function checkQuoteItemInventory(Mage_Sales_Model_Quote_Item $item) { // Only checking inventory that is managed and not a hidden parent item if (!$this->_inventoryItemSelection->isExcludedItem($item) && $this->_inventoryItemSelection->isStockManaged($item)) { // Determine if a stock message needs to be displayed if (!$this->isItemAvailable($item)) { $this->_handleUnavailableItem($item); } else { $this->_notifyCustomerIfItemBackorderable($item); } } return $this; }