diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/Invoice/Save.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/Invoice/Save.php index ab74a64b6fcf3..f3852d7292339 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/Invoice/Save.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/Invoice/Save.php @@ -194,12 +194,6 @@ public function execute() } $transactionSave->save(); - if (!empty($data['do_shipment'])) { - $this->messageManager->addSuccessMessage(__('You created the invoice and shipment.')); - } else { - $this->messageManager->addSuccessMessage(__('The invoice has been created.')); - } - // send invoice/shipment emails try { if (!empty($data['send_email'])) { @@ -219,6 +213,11 @@ public function execute() $this->messageManager->addErrorMessage(__('We can\'t send the shipment right now.')); } } + if (!empty($data['do_shipment'])) { + $this->messageManager->addSuccessMessage(__('You created the invoice and shipment.')); + } else { + $this->messageManager->addSuccessMessage(__('The invoice has been created.')); + } $this->_objectManager->get(\Magento\Backend\Model\Session::class)->getCommentText(true); return $resultRedirect->setPath('sales/order/view', ['order_id' => $orderId]); } catch (LocalizedException $e) {