/** * Retrieve required options from parent * * @return void */ protected function _beforeToHtml() { if (!$this->getParentBlock()) { throw new \Magento\Framework\Model\Exception(__('Please correct the parent block for this block.')); } $this->setOrder($this->getParentBlock()->getOrder()); foreach ($this->getParentBlock()->getOrderInfoData() as $k => $v) { $this->setDataUsingMethod($k, $v); } 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->setOrder($this->getParentBlock()->getOrder()); $this->setSource($this->getParentBlock()->getSource()); $this->setCurrency($this->getParentBlock()->getOrder()->getOrderCurrency()); foreach ($this->getParentBlock()->getOrderTotalbarData() as $v) { $this->addTotal($v[0], $v[1], $v[2]); } parent::_beforeToHtml(); }