Prakash Arul Mani
Prakash Arul Mani

Reputation: 627

How to retrieve abandoned cart details in Magento?

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

Answers (1)

Prakash Arul Mani
Prakash Arul Mani

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

Related Questions