customerSession = $customerSession; $this->httpContext = $httpContext; } /** * Set customer group and customer session id to HTTP context * * @param AbstractAction $subject * @param RequestInterface $request * @return void * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function beforeDispatch(AbstractAction $subject, RequestInterface $request) { $this->httpContext->setValue( Context::CONTEXT_GROUP, $this->customerSession->getCustomerGroupId(), GroupManagement::NOT_LOGGED_IN_ID ); $this->httpContext->setValue( Context::CONTEXT_AUTH, $this->customerSession->isLoggedIn(), false ); } }