diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/View.php b/app/code/Magento/Sales/Block/Adminhtml/Order/View.php index c83fb0f75a98e..72db6998c85ac 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/View.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/View.php @@ -77,9 +77,9 @@ protected function _construct() parent::_construct(); - $this->buttonList->remove('delete'); - $this->buttonList->remove('reset'); - $this->buttonList->remove('save'); + $this->removeButton('delete'); + $this->removeButton('reset'); + $this->removeButton('save'); $this->setId('sales_order_view'); $order = $this->getOrder(); @@ -92,7 +92,7 @@ protected function _construct() . $this->getEditMessage($order) . '\', url: \'' . $this->getEditUrl() . '\'}).orderEditDialog(\'showDialog\');'; - $this->buttonList->add( + $this->addButton( 'order_edit', [ 'label' => __('Edit'), @@ -106,7 +106,7 @@ protected function _construct() } if ($this->_isAllowedAction('Magento_Sales::cancel') && $order->canCancel()) { - $this->buttonList->add( + $this->addButton( 'order_cancel', [ 'label' => __('Cancel'), @@ -140,7 +140,7 @@ protected function _construct() if ($order->getPayment()->getMethodInstance()->isGateway()) { $onClick = "confirmSetLocation('{$message}', '{$this->getCreditmemoUrl()}')"; } - $this->buttonList->add( + $this->addButton( 'order_creditmemo', ['label' => __('Credit Memo'), 'onclick' => $onClick, 'class' => 'credit-memo'] ); @@ -159,7 +159,7 @@ protected function _construct() } if ($this->_isAllowedAction('Magento_Sales::hold') && $order->canHold()) { - $this->buttonList->add( + $this->addButton( 'order_hold', [ 'label' => __('Hold'), @@ -173,7 +173,7 @@ protected function _construct() } if ($this->_isAllowedAction('Magento_Sales::unhold') && $order->canUnhold()) { - $this->buttonList->add( + $this->addButton( 'order_unhold', [ 'label' => __('Unhold'), @@ -189,7 +189,7 @@ protected function _construct() if ($this->_isAllowedAction('Magento_Sales::review_payment')) { if ($order->canReviewPayment()) { $message = __('Are you sure you want to accept this payment?'); - $this->buttonList->add( + $this->addButton( 'accept_payment', [ 'label' => __('Accept Payment'), @@ -197,7 +197,7 @@ protected function _construct() ] ); $message = __('Are you sure you want to deny this payment?'); - $this->buttonList->add( + $this->addButton( 'deny_payment', [ 'label' => __('Deny Payment'), @@ -206,7 +206,7 @@ protected function _construct() ); } if ($order->canFetchPaymentReviewUpdate()) { - $this->buttonList->add( + $this->addButton( 'get_review_payment_update', [ 'label' => __('Get Payment Update'), @@ -218,7 +218,7 @@ protected function _construct() if ($this->_isAllowedAction('Magento_Sales::invoice') && $order->canInvoice()) { $_label = $order->getForcedShipmentWithInvoice() ? __('Invoice and Ship') : __('Invoice'); - $this->buttonList->add( + $this->addButton( 'order_invoice', [ 'label' => $_label, @@ -232,7 +232,7 @@ protected function _construct() 'Magento_Sales::ship' ) && $order->canShip() && !$order->getForcedShipmentWithInvoice() ) { - $this->buttonList->add( + $this->addButton( 'order_ship', [ 'label' => __('Ship'), @@ -248,7 +248,7 @@ protected function _construct() $order->getStore() ) && $order->canReorderIgnoreSalable() ) { - $this->buttonList->add( + $this->addButton( 'order_reorder', [ 'label' => __('Reorder'),