/** * Can render the block * * @return bool */ public function canRender() { $this->_ensureLoaded(); if ($this->_canRender == null) { $this->_canRender = parent::canRender() && !$this->isOrderConfirmationPage() && ($this->_hasAjaxScript() || $this->_hasCartJS() || $this->_hasCustomerJS()); } return $this->_canRender; }
/** * Render block * * @return string */ public function _toHtml() { try { if (!$this->canRender()) { return ''; } foreach ($this->getFields() as $field) { $this->addLine("_ltk.SCA.CaptureEmail({$this->toJsString($field)});"); } return parent::_toHtml(); } catch (Exception $e) { $this->getLogger()->addException($e); return ''; } }