Reputation: 627
I am creating a new extension in Magento version 2. Now I need to get abandoned carts report details. How can I retrieve this data?
Upvotes: 3
Views: 2777
Reputation: 627
Finally I found the way to get the abandoned cart details. Here is the code.
$om = \Magento\Framework\App\ObjectManager::getInstance();
$collection = $om->get('Magento\Reports\Model\ResourceModel\Quote\Collection');
$store_id = $this->storeManager->getStore()->getId();
$collection->prepareForAbandonedReport([$store_id]);
$rows = $collection->load();
Upvotes: 9