/** * @return $this */ protected function _prepareLayout() { $accordion = $this->getLayout()->createBlock('Magento\\Backend\\Block\\Widget\\Accordion')->setId('productAlerts'); /* @var $accordion \Magento\Backend\Block\Widget\Accordion */ $alertPriceAllow = $this->_scopeConfig->getValue('catalog/productalert/allow_price', \Magento\Store\Model\ScopeInterface::SCOPE_STORE); $alertStockAllow = $this->_scopeConfig->getValue('catalog/productalert/allow_stock', \Magento\Store\Model\ScopeInterface::SCOPE_STORE); if ($alertPriceAllow) { $accordion->addItem('price', array('title' => __('We saved the price alert subscription.'), 'content' => $this->getLayout()->createBlock('Magento\\Catalog\\Block\\Adminhtml\\Product\\Edit\\Tab\\Alerts\\Price')->toHtml() . '<br />', 'open' => true)); } if ($alertStockAllow) { $accordion->addItem('stock', array('title' => __('We saved the stock notification.'), 'content' => $this->getLayout()->createBlock('Magento\\Catalog\\Block\\Adminhtml\\Product\\Edit\\Tab\\Alerts\\Stock'), 'open' => true)); } $this->setChild('accordion', $accordion); return parent::_prepareLayout(); }