$objectManager = MagentoFrameworkAppObjectManager::getInstance(); $customerSession = $objectManager->get('MagentoCustomerModelSession'); if($customerSession->isLoggedIn()) { // customer login action }