I am writing the REST API in Magento to retrieve the Abandoned cart details. In the API, I have tried the below code. but it is not working.
$collection = Mage::getResourceModel('reports/quote_collection');
$collection->prepareForAbandonedReport(array(1));
$collection->load();
Same thing I did for products count. which is working fine. Please find the code below and I need the same thing for abandoned cart detail retrieve.
$collection = Mage::getResourceModel('catalog/product_collection');
$store = $this->_getStore();
$collection->setStoreId($store->getId());
$collection->addAttributeToSelect(array_keys(
$this->getAvailableAttributes($this->getUserType(), Mage_Api2_Model_Resource::OPERATION_ATTRIBUTE_READ)
));
$this->_applyCategoryFilter($collection);
$this->_applyCollectionModifiers($collection);
$products = $collection->load()->toArray();
$size = $collection->getSize();
$productCount = new stdClass();
$productCount->catalog_size=$size;
The Above code I have written in the V1.php ( inside the REST API folder).