/** * Render block * * @return string */ public function _toHtml() { try { if (!$this->canRender()) { return ''; } $sku = $this->_getProductSku(); if ($sku) { $this->addLine("_ltk.Activity.AddProductBrowse({$this->toJsString($sku)}, { 'store': '" . Mage::app()->getStore()->getCode() . "' });"); } else { $this->addLine("_ltk.Activity.AddPageBrowse(location.href, { 'store': '" . Mage::app()->getStore()->getCode() . "' });"); } $this->addLine("_ltk.Activity.Submit();"); return parent::_toHtml(); } catch (Exception $e) { $this->getLogger()->addException($e); return ''; } }
public function _toHtml() { try { if (!$this->canRender()) { return ''; } $sku = $this->getProductSku(); if ($sku) { $this->addLine("_ltk.Activity.AddProductBrowse({$this->toJsString($sku)});"); } else { $this->addLine("_ltk.Activity.AddPageBrowse(location.href);"); } $this->addLine("_ltk.Activity.Submit();"); return parent::_toHtml(); } catch (Exception $e) { Mage::getModel('listrak/log')->addException($e); return ''; } }