Magento 2: Different Ways To Check if Customer is Logged In
This article shows different ways to check if a customer is logged in or not in Magento 2. 1) Using \Magento\Customer\Model\Session class The main issue with this way is that it will not work when page cache is enabled. When page cache is enabled and you use this code, it will not be able to … Read more