public function _toHtml() { $pretext = $this->getConfig("pretext"); $pretext = base64_decode($pretext); $this->setData("pretext", $pretext); return parent::_toHtml(); }
public function _toHtml() { $pretext = $this->getConfig("pretext"); $pretext = base64_decode($pretext); $filter_group = $this->getConfig('filter_group'); $show = $this->getConfig("show"); $limit = (int) $this->getConfig('itemvisiable'); if (!$show) { return; } $collection = Mage::getModel('ves_brand/brand')->getCollection(); $collection->addFieldToFilter("group_brand_id", array("eq" => $filter_group))->addFieldToFilter('is_active', 1)->setOrder('position', 'ASC'); if ($limit) { $collection->setPageSize($limit); } $resroute = Mage::getStoreConfig('ves_brand/general_setting/route'); $extension = ".html"; foreach ($collection as $model) { if (!$model->getLink()) { Mage::getModel('core/url_rewrite')->loadByIdPath('venusbrand/brand/' . $model->getId())->setIdPath('venusbrand/brand/' . $model->getId())->setRequestPath($resroute . '/' . $model->getIdentifier() . $extension)->setTargetPath('venusbrand/brand/view/id/' . $model->getId())->save(); } } $this->setData("pretext", $pretext); $this->assign('resroute', $resroute); return parent::_toHtml(); }