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-sales
Controller
AbstractController
OrderViewAuthorization.php
Go to the documentation of this file.
1
<?php
8
namespace
Magento\Sales\Controller\AbstractController
;
9
10
class
OrderViewAuthorization
implements
OrderViewAuthorizationInterface
11
{
15
protected
$customerSession
;
16
20
protected
$orderConfig
;
21
26
public
function
__construct
(
27
\
Magento
\Customer\Model\Session
$customerSession
,
28
\
Magento
\Sales\Model\Order\Config
$orderConfig
29
) {
30
$this->customerSession =
$customerSession
;
31
$this->orderConfig =
$orderConfig
;
32
}
33
37
public
function
canView
(\
Magento
\Sales\Model\Order
$order
)
38
{
39
$customerId
= $this->customerSession->getCustomerId();
40
$availableStatuses = $this->orderConfig->getVisibleOnFrontStatuses();
41
if
(
$order
->getId()
42
&&
$order
->getCustomerId()
43
&&
$order
->getCustomerId() ==
$customerId
44
&& in_array(
$order
->getStatus(), $availableStatuses,
true
)
45
) {
46
return
true
;
47
}
48
return
false
;
49
}
50
}
Magento\Sales\Controller\AbstractController\OrderViewAuthorization\$orderConfig
$orderConfig
Definition:
OrderViewAuthorization.php:20
Magento\Sales\Controller\AbstractController\OrderViewAuthorization\__construct
__construct(\Magento\Customer\Model\Session $customerSession, \Magento\Sales\Model\Order\Config $orderConfig)
Definition:
OrderViewAuthorization.php:26
$order
$order
Definition:
order.php:55
Magento\Sales\Controller\AbstractController
Definition:
Creditmemo.php:7
$customerId
$customerId
Definition:
quote_with_customer.php:16
Magento\Sales\Controller\AbstractController\OrderViewAuthorizationInterface
Definition:
OrderViewAuthorizationInterface.php:13
Magento
Magento\Sales\Controller\AbstractController\OrderViewAuthorization\$customerSession
$customerSession
Definition:
OrderViewAuthorization.php:15
Magento\Sales\Controller\AbstractController\OrderViewAuthorization
Definition:
OrderViewAuthorization.php:10
Magento\Sales\Controller\AbstractController\OrderViewAuthorization\canView
canView(\Magento\Sales\Model\Order $order)
Definition:
OrderViewAuthorization.php:37