Magento 1 get quote id of current user

I've gone through a number of questions on here relating to retrieving the current quote for the current browsing user, but each one yields the same result:

Mage::getSingleton('checkout/cart')->getQuote()
Mage::getSingleton('checkout/session')->getQuote()

Both give me a quote that has an entity_id of one less than the actual quote I'm looking for.

I can see the correct quote in the db as, let's say id #100002, but this returns id #100001.

I know that this is not the correct quote because running getCouponCode() returns null and I can see that is because the entity_id that is returned doesn't have one set, but the actual cart does have a coupon code and so does the entity_id that follows next.



from Active questions tagged magento-enterprise - Magento Stack Exchange

Click link to view all answer https://magento.stackexchange.com/questions/282556/magento-1-get-quote-id-of-current-user