_coreRegistry = $coreRegistry; $this->_fileFactory = $fileFactory; $this->_dateFilter = $dateFilter; } /** * Initiate rule * * @return void */ protected function _initRule() { $this->_coreRegistry->register( \Magento\SalesRule\Model\RegistryConstants::CURRENT_SALES_RULE, $this->_objectManager->create(\Magento\SalesRule\Model\Rule::class) ); $id = (int)$this->getRequest()->getParam('id'); if (!$id && $this->getRequest()->getParam('rule_id')) { $id = (int)$this->getRequest()->getParam('rule_id'); } if ($id) { $this->_coreRegistry->registry(\Magento\SalesRule\Model\RegistryConstants::CURRENT_SALES_RULE)->load($id); } } /** * Initiate action * * @return $this */ protected function _initAction() { $this->_view->loadLayout(); $this->_setActiveMenu('Magento_SalesRule::promo_quote')->_addBreadcrumb(__('Promotions'), __('Promotions')); return $this; } }