Magento2: How to get registered online customer only?
-
13-04-2021 - |
Pregunta
customer_list.phtml
$om = \Magento\Framework\App\ObjectManager::getInstance();
$customerSession = $om->create('Magento\Customer\Model\ResourceModel\Online\Grid\Collection');
$customerData = $customerSession->getData();
echo "<pre/>";
print_r($customerData);
exit;
Result
Expected result
I want to show registered online customer only.
Solución
In your collection, You can add filter like email id
Or Customer Id
is not empty.
So it will give you only registered customer.
When Customer log out , Collection will remove that customer.
Licenciado bajo: CC-BY-SA con atribución
No afiliado a magento.stackexchange