httpContext = $httpContext; } /** * Checking customer login status * * @return bool */ public function customerLoggedIn() { return (bool)$this->httpContext->getValue(\Magento\Customer\Model\Context::CONTEXT_AUTH); } }