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
Block
Adminhtml
Edit
OrderButton.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Customer\Block\Adminhtml\Edit
;
7
8
use
Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface
;
9
13
class
OrderButton
extends
GenericButton
implements
ButtonProviderInterface
14
{
18
protected
$authorization
;
19
26
public
function
__construct
(
27
\
Magento
\Backend\Block\Widget\
Context
$context,
28
\
Magento
\Framework\Registry
$registry
29
) {
30
$this->authorization = $context->getAuthorization();
31
parent::__construct($context,
$registry
);
32
}
33
37
public
function
getButtonData
()
38
{
39
$customerId
= $this->
getCustomerId
();
40
$data
= [];
41
if
(
$customerId
&& $this->authorization->isAllowed(
'Magento_Sales::create'
)) {
42
$data
= [
43
'label'
=>
__
(
'Create Order'
),
44
'on_click'
=> sprintf(
"location.href = '%s';"
, $this->
getCreateOrderUrl
()),
45
'class'
=>
'add'
,
46
'sort_order'
=> 40,
47
];
48
}
49
return
$data
;
50
}
51
57
public
function
getCreateOrderUrl
()
58
{
59
return
$this->
getUrl
(
'sales/order_create/start'
, [
'customer_id'
=> $this->
getCustomerId
()]);
60
}
61
}
Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface
Definition:
ButtonProviderInterface.php:11
Magento\Customer\Block\Adminhtml\Edit\GenericButton\getCustomerId
getCustomerId()
Definition:
GenericButton.php:49
Magento\Customer\Block\Adminhtml\Edit
__
__()
Definition:
__.php:13
Magento\Customer\Block\Adminhtml\Edit\GenericButton\getUrl
getUrl($route='', $params=[])
Definition:
GenericButton.php:61
Magento\Customer\Block\Adminhtml\Edit\GenericButton\$registry
$registry
Definition:
GenericButton.php:28
$data
$data
Definition:
attribute_set_with_image_attribute.php:16
$customerId
$customerId
Definition:
quote_with_customer.php:16
Magento\Customer\Block\Adminhtml\Edit\OrderButton\$authorization
$authorization
Definition:
OrderButton.php:18
Magento\Customer\Block\Adminhtml\Edit\GenericButton
Definition:
GenericButton.php:14
Magento
Magento\Customer\Block\Adminhtml\Edit\OrderButton\getCreateOrderUrl
getCreateOrderUrl()
Definition:
OrderButton.php:57
Context
Definition:
ClassesForConstructorIntegrity.php:33
Magento\Customer\Block\Adminhtml\Edit\OrderButton\getButtonData
getButtonData()
Definition:
OrderButton.php:37
Magento\Customer\Block\Adminhtml\Edit\OrderButton
Definition:
OrderButton.php:13
Magento\Customer\Block\Adminhtml\Edit\OrderButton\__construct
__construct(\Magento\Backend\Block\Widget\Context $context, \Magento\Framework\Registry $registry)
Definition:
OrderButton.php:26