Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-customer
Model
App
Action
ContextPlugin.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Customer\Model\App\Action
;
8
9
use
Magento\Customer\Model\Context
;
10
use
Magento\Customer\Model\GroupManagement
;
11
use
Magento\Framework\App\Action\AbstractAction
;
12
use
Magento\Framework\App\RequestInterface
;
13
use
Magento\Customer\Model\Session
;
14
use
Magento\Framework\App\Http\Context
as HttpContext;
15
19
class
ContextPlugin
20
{
24
protected
$customerSession
;
25
29
protected
$httpContext
;
30
35
public
function
__construct
(
Session
$customerSession
, HttpContext
$httpContext
)
36
{
37
$this->customerSession =
$customerSession
;
38
$this->httpContext =
$httpContext
;
39
}
40
49
public
function
beforeDispatch
(
AbstractAction
$subject,
RequestInterface
$request
)
50
{
51
$this->httpContext->setValue(
52
Context::CONTEXT_GROUP
,
53
$this->customerSession->getCustomerGroupId(),
54
GroupManagement::NOT_LOGGED_IN_ID
55
);
56
$this->httpContext->setValue(
57
Context::CONTEXT_AUTH
,
58
$this->customerSession->isLoggedIn(),
59
false
60
);
61
}
62
}
Magento\Customer\Model\Session
Definition:
Storage.php:8
false
return false
Definition:
gallery.phtml:36
Magento\Customer\Model\Context\CONTEXT_GROUP
const CONTEXT_GROUP
Definition:
Context.php:13
Magento\Customer\Model\GroupManagement
Definition:
GroupManagement.php:23
Magento\Customer\Model\Session
Definition:
Session.php:22
Magento\Customer\Model\Context\CONTEXT_AUTH
const CONTEXT_AUTH
Definition:
Context.php:18
Magento\Framework\App\RequestInterface
Definition:
RequestInterface.php:14
Magento\Customer\Model\App\Action\ContextPlugin\$httpContext
$httpContext
Definition:
ContextPlugin.php:29
$request
$request
Definition:
quote_with_configurable_product_last_variation.php:22
Magento\Framework\App\Http\Context
Definition:
Context.php:14
Magento\Customer\Model\App\Action
Definition:
ContextPlugin.php:7
Magento\Customer\Model\App\Action\ContextPlugin\__construct
__construct(Session $customerSession, HttpContext $httpContext)
Definition:
ContextPlugin.php:35
Magento\Framework\App\Action\AbstractAction
Definition:
AbstractAction.php:13
Magento\Customer\Model\App\Action\ContextPlugin
Definition:
ContextPlugin.php:19
Magento\Customer\Model\App\Action\ContextPlugin\$customerSession
$customerSession
Definition:
ContextPlugin.php:24
Magento\Customer\Model\Context
Definition:
Context.php:8
Magento\Customer\Model\App\Action\ContextPlugin\beforeDispatch
beforeDispatch(AbstractAction $subject, RequestInterface $request)
Definition:
ContextPlugin.php:49
Magento\Customer\Model\GroupManagement\NOT_LOGGED_IN_ID
const NOT_LOGGED_IN_ID
Definition:
GroupManagement.php:27