Magento2 – How to load Quote by Quote id

By Using Object Manager you can inject the instace of \Magento\Quote\Model\QuoteFactory
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$quoteFactory = $objectManager->create('\Magento\Quote\Model\QuoteFactory');
$q = $quoteFactory->create()->load($quoteId);
The other and recommended way, you can load the quote id by injecting the instance of \Magento\Quote\Model\QuoteFactory

protected $quoteFactory;
public function __construct(
  \Magento\Quote\Model\QuoteFactory $quoteFactory
   $this -> quoteFactory = $quoteFactory;
To use it you can write: $q = $this->quoteFactory->create()->load($quoteId);

2 Replies to “Magento2 – How to load Quote by Quote id”

Leave a Reply

Your email address will not be published. Required fields are marked *