I'm trying to get the shopping cart ID given the customer ID, to expose it by SOAP API.
Calling the web service with an ID 1 returns nothing.
What am I missing here?
Here's the code for the web service
public function getShoppingCartId($customerId)
{
Mage::log(__METHOD__);
$customer = Mage::getModel('customer/customer');
$customer = $customer->load($customerId);
Mage::log('Getting shopping cart of '. $customer->getName() .' ('. $customer->getEmail() .'), ID: ' . $customer->getId() );
$quote = Mage::getModel('sales/quote')->loadByCustomer($customer);
Mage::log("-------------------------------------------");
return $quote->getId();
}
This is the log output
DEBUG (7): Phoenix_Moneybookers_Model_Core_Api::getShoppingCartId
DEBUG (7): Getting shopping cart of John Doe ([email protected]), ID: 1
DEBUG (7): -------------------------------------------