coreRegistry = $coreRegistry; } /** * Save order into registry to use it in the overloaded controller. * * @param \Magento\Framework\Event\Observer $observer * @return $this */ public function execute(\Magento\Framework\Event\Observer $observer) { /* @var $order Order */ $order = $observer->getEvent()->getData('order'); $this->coreRegistry->register('directpost_order', $order, true); return $this; } }