1

It's really common to get the quote with an existing session.

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

But now I want to get the quote by user without any session (Magento 1.9). Do you have an advice for me?

  • Your only need if you want to load a quote without session is a customer, take a look at my answer. – Matthéo Geoffray Jan 28 '16 at 15:31
  • @SimonSolutions In which place you want to get the quote? During checkout steps? – sv3n Jul 18 '17 at 0:08
2

If you take a look at Mage_Sales_Model_Quote class you can see the function loadByCustomer.
With that you only need a Mage_Customer_Model_Customer object instance.

/** @var Mage_Customer_Model_Customer $customer **/
$quote = Mage::getModel('sales/quote')->loadByCustomer($customer);
1

If want to get Cart/Quote details then must need Quote id.

Using Mage::getModel('sales/quote') Model with help of Quote id,you can get details

Without Quote id is not possible to get data.

1

You can simply get the quote by customer with out session as below.

Mage::getModel('sales/quote')->loadByCustomer($this->_customer);
0

You could try to get it by customer_id, at least the data supports it but i doubt that it is possible with "normal magento model api" without a session.

0

=> You can simply use load method of the model :

/*@var $quote Mage_Sales_Model_Quote*/

$quote = Mage::getModel('sales/quote')->load($quoteId);

It may be helpful for you.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.