/** * {@inheritdoc} */ protected function _beforeToHtml() { $this->assign('form', $this->_form); $this->assign('element', $this->_element); $this->assign('formBlock', $this->_formBlock); return parent::_beforeToHtml(); }
/** * Retrieve required options from parent * * @return void * @throws \Magento\Framework\Exception\LocalizedException */ protected function _beforeToHtml() { if (!$this->getParentBlock()) { throw new \Magento\Framework\Exception\LocalizedException(__('Please correct the parent block for this block.')); } $this->setEntity($this->getParentBlock()->getSource()); parent::_beforeToHtml(); }
/** * Retrieve required options from parent * * @return void * @throws \Magento\Framework\Model\Exception */ protected function _beforeToHtml() { if (!$this->getParentBlock()) { throw new \Magento\Framework\Model\Exception(__('Invalid parent block for this block')); } $this->setPayment($this->getParentBlock()->getOrder()->getPayment()); parent::_beforeToHtml(); }
/** * Before rendering html, but after trying to load cache * * @return AbstractBlock */ protected function _beforeToHtml() { $this->setChild('form', $this->getLayout()->createBlock('Magento\\Newsletter\\Block\\Adminhtml\\Queue\\Edit\\Form', 'form')); return parent::_beforeToHtml(); }
/** * {@inheritdoc} */ protected function _beforeToHtml() { // TODO - Moved to Beta 2, no breadcrumbs displaying in Beta 1 // $this->assign('links', $this->_links); return parent::_beforeToHtml(); }
/** * Execute before toHtml() code. * * @return $this */ public function _beforeToHtml() { $this->_currency = $this->_currencyFactory->create()->load($this->_scopeConfig->getValue(Currency::XML_PATH_CURRENCY_BASE, \Magento\Store\Model\ScopeInterface::SCOPE_STORE)); $this->_collection = $this->_collectionFactory->create()->setCustomerIdFilter((int) $this->_coreRegistry->registry(RegistryConstants::CURRENT_CUSTOMER_ID))->setOrderStateFilter(Order::STATE_CANCELED, true)->load(); $this->_groupedCollection = []; foreach ($this->_collection as $sale) { if ($sale->getStoreId() !== null) { $store = $this->_storeManager->getStore($sale->getStoreId()); $websiteId = $store->getWebsiteId(); $groupId = $store->getGroupId(); $storeId = $store->getId(); $sale->setWebsiteId($store->getWebsiteId()); $sale->setWebsiteName($store->getWebsite()->getName()); $sale->setGroupId($store->getGroupId()); $sale->setGroupName($store->getGroup()->getName()); } else { $websiteId = 0; $groupId = 0; $storeId = 0; $sale->setStoreName(__('Deleted Stores')); } $this->_groupedCollection[$websiteId][$groupId][$storeId] = $sale; $this->_websiteCounts[$websiteId] = isset($this->_websiteCounts[$websiteId]) ? $this->_websiteCounts[$websiteId] + 1 : 1; } return parent::_beforeToHtml(); }
/** * @return $this */ public function _beforeToHtml() { return parent::_beforeToHtml(); }
/** * Prepares block to render * * @return $this */ protected function _beforeToHtml() { return parent::_beforeToHtml(); }