messageManager = $messageManager; $this->taxRegistry = $taxRegistry; } /** * Resend data from the message manager to the target message block pre-render. * * @param Totals $subject * @return void */ private function updateMessageBlock(Totals $context) { /** @var \Magento\Sales\Block\Adminhtml\Order\Create\Messages|bool $block */ $block = $context->getLayout()->getBlock('message'); if ($block instanceof BlockInterface) { $block->addMessages($this->messageManager->getMessages(true)); } } /** * Add tax service errors after totals collection. * * @param Totals $subject * @param array $results * @return array */ public function afterGetTotals(Totals $subject, array $results) { if (!$this->hasNotified) { $error = $this->taxRegistry->lookup(TaxRegistry::KEY_ERROR_GENERIC); if (!empty($error)) { $this->updateMessageBlock($subject); $this->hasNotified = true; } } return $results; } }