/** * Prepare global layout * * Add "Add Group Price" button to layout * * @return $this */ protected function _prepareLayout() { $button = $this->getLayout()->createBlock('Magento\\Backend\\Block\\Widget\\Button')->setData(['label' => __('Add Group Price'), 'onclick' => 'return groupPriceControl.addItem()', 'class' => 'add']); $button->setName('add_group_price_item_button'); $this->setChild('add_button', $button); return parent::_prepareLayout(); }
public function __construct(Context $context, GroupRepositoryInterface $groupRepository, Data $directoryHelper, Manager $moduleManager, Registry $registry, GroupManagementInterface $groupManagement, SearchCriteriaBuilder $searchCriteriaBuilder, CurrencyInterface $localeCurrency, LoggerInterface $loggerInterface, AttributeFactory $attributeFactory, $data = []) { $this->_logger = $loggerInterface; $this->_attributeFactory = $attributeFactory; parent::__construct($context, $groupRepository, $directoryHelper, $moduleManager, $registry, $groupManagement, $searchCriteriaBuilder, $localeCurrency, $data); }