checkoutSession = $checkoutSession; } /** * @param \Magento\Framework\Event\Observer $observer * @return void */ public function execute(\Magento\Framework\Event\Observer $observer) { $quote = $observer->getEvent()->getQuote(); /* @var $quote \Magento\Quote\Model\Quote */ if ($quote->getIsCheckoutCart()) { $this->checkoutSession->getQuoteId($quote->getId()); } } }