Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. protected $_session;
  2. protected $_context;
  3.  
  4. public function __construct(
  5. MagentoCustomerModelSession $session,
  6. MagentoFrameworkViewElementTemplateContext $context
  7. ) {
  8. parent::__construct($context);
  9. $this->objectManager = $context->getObjectManager();
  10. }
  11.  
  12.  
  13. public function isCustomerLoggedIn()
  14. {
  15. $session = $this->objectManager->get('MagentoCustomerModelSession');
  16. if($session->isLoggedIn()) {
  17. status = "Customer logged in";
  18. }else{
  19. status = "Not customer logged in";
  20. }
  21. return status;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement