0

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.

  • You are doing it correctly, if you are using it in local or staging, then Truncate sessions and try again with the same criteria – Shoaib Munir Jul 18 at 15:59
  • I've been backtracking and can't seem to figure out how the cart is getting its session that my code is not. It runs the same function that I am to get the quote only it returns the correct object and mine returns essentially a blank quote. – joeybab3 Jul 18 at 16:17
  • Have you tried clearing session and try again? – Shoaib Munir Jul 18 at 17:35
  • Yes, I've tried logged in, not logged in, clearing the session, incognito window but they all yield the same result – joeybab3 Jul 18 at 19:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.