Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use MagentoCustomerModelContext as CustomerContext;
- use MagentoCustomerModelContext;
- use MagentoFrameworkAppHttpContext as HttpContext;
- /**
- * @param HttpContext $httpContext
- */
- public function __construct(HttpContext $httpContext)
- {
- $this->httpContext = $httpContext;
- }
- /**
- * @return bool
- */
- private function isLoggedIn()
- {
- return (bool)$this->httpContext->getValue(Context::CONTEXT_AUTH);
- }
- if (null === $customerId) {
- if ($this->httpContext->getValue(CustomerContext::CONTEXT_AUTH)) {
- if (!$this->session->isSessionExists()) {
- $this->session->start();
- }
- $visitorData = $this->session->getData('visitor_data');
- if (isset($visitorData['customer_id'])) {
- $customerId = $visitorData['customer_id'];
- }
- }
- }
Add Comment
Please, Sign In to add comment