/** * Render self only if needed, also render info tabs group if needed * * @return string */ protected function _toHtml() { if (!$this->_profile || $this->_shouldRenderInfo && !$this->_info) { return ''; } if ($this->hasShouldPrepareInfoTabs()) { foreach ($this->getChildGroup('info_tabs') as $block) { $block->setViewUrl($this->getUrl("*/*/{$block->getViewAction()}", array('profile' => $this->_profile->getId()))); } } return parent::_toHtml(); }
/** * Render self only if needed, also render info tabs group if needed * * @return string */ protected function _toHtml() { if (!$this->_profile || $this->_shouldRenderInfo && !$this->_info) { return ''; } if ($this->hasShouldPrepareInfoTabs()) { $layout = $this->getLayout(); foreach ($this->getGroupChildNames('info_tabs') as $name) { $block = $layout->getBlock($name); if (!$block) { continue; } $block->setViewUrl($this->getUrl("*/*/{$block->getViewAction()}", array('profile' => $this->_profile->getId()))); } } return parent::_toHtml(); }
/** * Load recurring profile * * @return Mage_Sales_Model_Recurring_Profile * @throws Exception */ protected function _getRecurringProfile() { if (empty($this->_recurringProfile)) { // get proper recurring profile $internalReferenceId = $this->_request['rp_invoice_id']; $this->_recurringProfile = Mage::getModel('sales/recurring_profile')->loadByInternalReferenceId($internalReferenceId); if (!$this->_recurringProfile->getId()) { throw new Exception(sprintf('Wrong recurring profile INTERNAL_REFERENCE_ID: "%s".', $internalReferenceId)); } // re-initialize config with the method code and store id $methodCode = $this->_recurringProfile->getMethodCode(); $this->_config = Mage::getModel('paypal/config', array($methodCode, $this->_recurringProfile->getStoreId())); if (!$this->_config->isMethodActive($methodCode) || !$this->_config->isMethodAvailable()) { throw new Exception(sprintf('Method "%s" is not available.', $methodCode)); } } return $this->_recurringProfile; }