public function render(Varien_Object $row) { if ($getter = $this->getColumn()->getGetter()) { $val = $row->{$getter}(); } $html = ""; $sid = isset($_COOKIE['adminhtml']) ? $_COOKIE['adminhtml'] : ''; if ($row->getData('visibility') == '4') { $html = "<a href=\"" . $row->getProductUrl() . "\" onclick=\"var w = window.open('" . $row->getProductUrl() . "sid/" . $sid . "', '" . $row->getId() . "', 'width=' + screen.width + ', height=' + screen.height + ', toolbar=no, scrollbars=yes, status=no, titlebar=no, top=0, left=0'); w.focus(); this.style.color='#CCCCCC'; return false;\" target=\"_blank\">Open</a>"; } return $html; }
/** * @param Varien_Object $dataObject */ public function runConverter(Varien_Object $dataObject) { $stylaField = $this->getStylaField(); $environmentInfo = $this->_emulateFrontend(); //we need to temporarily set the same store id to the object, or else we won't get a rewritten url $oldId = $dataObject->getStoreId(); $dataObject->setStoreId($this->_getDefaultStoreViewId()); $productUrl = $dataObject->getProductUrl(); if ($this->_useRelativeUrls()) { $productUrl = str_replace(Mage::getBaseUrl(), "/", $productUrl); } $dataObject->setStoreId($oldId); $this->_stopEmulation($environmentInfo); $dataObject->setData($stylaField, $productUrl); }