Magento 2 Get Current Quote Id


Magento 2 Get Current Quote Id From Session – You can use object manager to get the current quote/cart session object, using this object you can get the quote details. Here in this article we are going to explain how you can get quote id quickly.


Magento 2 Get Current Quote Id From Session Example

Magento 2 Get Current Quote Id

Here in a simple example to get the quote id from session –

Magento 2 Get Current Quote Id From Session Example:

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$cart = $objectManager->get('\Magento\Checkout\Model\Cart');

$quote = $cart->getQuote();
// This will return the current quote
$quoteId = $quote->getId();

The above example will give the current quote id.

Tags

magento 2 get quote id from checkout session


Advertisements

Add Comment

📖 Read More