15 class Create extends \Magento\Backend\Block\Widget\Form\Container
34 $this->_sessionQuote = $sessionQuote;
35 parent::__construct($context,
$data);
45 $this->_objectId =
'order_id';
46 $this->_controller =
'order';
47 $this->_mode =
'create';
51 $this->setId(
'sales_order_create');
53 $customerId = $this->_sessionQuote->getCustomerId();
54 $storeId = $this->_sessionQuote->getStoreId();
56 $this->buttonList->update(
'save',
'label',
__(
'Submit Order'));
57 $this->buttonList->update(
'save',
'onclick',
'order.submit()');
58 $this->buttonList->update(
'save',
'class',
'primary');
60 $this->buttonList->update(
'save',
'data_attribute', []);
62 $this->buttonList->update(
'save',
'id',
'submit_order_top_button');
64 $this->buttonList->update(
'save',
'style',
'display:none');
67 $this->buttonList->update(
'back',
'id',
'back_order_top_button');
68 $this->buttonList->update(
'back',
'onclick',
'setLocation(\'' . $this->
getBackUrl() .
'\')
'); 70 $this->buttonList->update('reset
', 'id', 'reset_order_top_button
'); 72 if ($customerId === null) { 73 $this->buttonList->update('reset
', 'style
', 'display:none
'); 75 $this->buttonList->update('back
', 'style
', 'display:none
'); 78 $confirm = __('Are you sure you want to cancel
this order?
'); 79 $this->buttonList->update('reset
', 'label
', __('Cancel
')); 80 $this->buttonList->update('reset
', 'class', 'cancel
'); 81 $this->buttonList->update( 84 'deleteConfirm(\
'' . $confirm .
'\', \
'' . $this->
getCancelUrl() .
'\')
' 93 protected function _prepareLayout() 95 $pageTitle = $this->getLayout()->createBlock( 96 \Magento\Sales\Block\Adminhtml\Order\Create\Header::class 98 if (is_object($this->getLayout()->getBlock('page.title
'))) { 99 $this->getLayout()->getBlock('page.title
')->setPageTitle($pageTitle); 101 return parent::_prepareLayout(); 109 public function getHeaderHtml() 111 $out = '<div
id=
"order-header">
' . $this->getLayout()->createBlock( 112 \Magento\Sales\Block\Adminhtml\Order\Create\Header::class 113 )->toHtml() . '</div>
'; 122 public function getHeaderWidth() 124 return 'width: 70%;
'; 132 protected function _getSession() 134 return $this->_sessionQuote; 142 public function getCancelUrl() 144 if ($this->_sessionQuote->getOrder()->getId()) { 145 $url = $this->getUrl('sales/order/view
', ['order_id
' => $this->_sessionQuote->getOrder()->getId()]); 147 $url = $this->getUrl('sales
__construct(\Magento\Backend\Block\Widget\Context $context, \Magento\Backend\Model\Session\Quote $sessionQuote, array $data=[])