It's really common to get the quote with an existing session.
But now I want to get the quote by user without any session (Magento 1.9). Do you have an advice for me?
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.Sign up to join this community
If you take a look at
Mage_Sales_Model_Quote class you can see the function
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);
If want to get
Cart/Quote details then must need Quote id.
Mage::getModel('sales/quote') Model with help of Quote id,you can get details
Without Quote id is not possible to get data.
You can simply get the quote by customer with out session as below.
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.
=> 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.