Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected $_session;
- protected $_context;
- public function __construct(
- MagentoCustomerModelSession $session,
- MagentoFrameworkViewElementTemplateContext $context
- ) {
- parent::__construct($context);
- $this->objectManager = $context->getObjectManager();
- }
- public function isCustomerLoggedIn()
- {
- $session = $this->objectManager->get('MagentoCustomerModelSession');
- if($session->isLoggedIn()) {
- status = "Customer logged in";
- }else{
- status = "Not customer logged in";
- }
- return status;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement