/** * Before collecting item totals, check that all items * in the quote are available to be fulfilled. * * @param Varien_Event_Observer * @return self */ public function handleBeforeCollectTotals(Varien_Event_Observer $observer) { try { $quote = $observer->getEvent()->getQuote(); $this->quantityService->checkQuoteInventory($quote); } catch (EbayEnterprise_Inventory_Exception_Quantity_Collector_Exception $e) { $this->logger->warning($e->getMessage(), $this->logContext->getMetaData(__CLASS__, [], $e)); } return $this; }
/** * Before collecting item totals, check that all items * in the quote are available to be fulfilled. * * @param Varien_Event_Observer * @return self */ public function handleBeforeCollectTotals(Varien_Event_Observer $observer) { try { $quote = $observer->getEvent()->getQuote(); $this->quantityService->checkQuoteInventory($quote); } catch (EbayEnterprise_Inventory_Exception_Quantity_Collector_Exception $e) { $this->logger->logException($e, $this->logContext->getMetaData(__CLASS__, [], $e)); $this->logger->warning('Caught the following exception: {exception_message}.', $this->logContext->getMetaData(__CLASS__, ['exception_message' => $e->getMessage()])); } catch (EbayEnterprise_Inventory_Exception_Quantity_Unavailable_Exception $e) { $this->logger->logException($e, $this->logContext->getMetaData(__CLASS__, [], $e)); $this->logger->warning('Caught the following exception: {exception_message}.', $this->logContext->getMetaData(__CLASS__, ['exception_message' => $e->getMessage()])); if ($this->app->getStore()->isAdmin()) { // Handling admin exception here because it is not // being caught in the admin controller causing it // to display exception traces in the page. return $this->handleAdminOrderException($e, $quote); } // Continue to throw the exception in the frontend and let // the frontend controller handle it. throw $e; } return $this; }