public function _toHtml() { $this->setTemplate("ves/brand/block/brandnav.phtml"); $collection = Mage::getModel("ves_brand/brand")->getCollection(); $this->assign("brands", $collection); return parent::_toHtml(); }
public function _toHtml() { // if(!$this->getConfig("enable_groupmodule")) { // return ; // } $menus = $this->getCategoryBrand(); // Assign html $this->setCategoryBrands($menus); return parent::_toHtml(); }
public function _toHtml() { $this->_show = $this->getGeneralConfig("show"); $enable_scroll = $this->getModuleConfig("enable_brandnavmodule"); if (!$this->_show || !$enable_scroll) { return; } $this->setTemplate("ves/brand/block/brandnav.phtml"); $collection = Mage::getModel("ves_brand/brand")->getCollection(); $limit = $this->getModuleConfig("brandnav_limit"); if ($limit != "" || (int) $limit > 0) { $collection->setPageSize($limit)->setCurPage(1); } $this->assign("brands", $collection); return parent::_toHtml(); }
public function _toHtml() { $this->_show = $this->getGeneralConfig("show"); $enable_scroll = $this->getModuleConfig("enable_scrollmodule"); if (!$this->_show || !$enable_scroll) { return; } $collection = Mage::getModel('ves_brand/brand')->getCollection(); $collection->addFieldToFilter('is_active', 1); $collection->setOrder('position', 'ASC'); $collection->setPageSize($this->getConfig('itemvisiable')); $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->assign('brands', $collection); $this->setTemplate("ves/brand/block/scroll.phtml"); return parent::_toHtml(); }
protected function _toHtml() { $this->_show = $this->getGeneralConfig("show"); $enable_scroll = $this->getConfig("enable_scrollmodule"); $limit = (int) $this->getConfig('itemvisiable'); $filter_group = $this->getConfig('filter_group'); if (!$this->_show || !$enable_scroll) { return; } $collection = Mage::getModel('ves_brand/brand')->getCollection(); $grouparr = explode(",", $filter_group); //Check if filter by brand group, if not will get all brand items if ($filter_group) { $collection->addFieldToFilter("group_brand_id", array("in" => $grouparr)); $this->_brand_group = Mage::getModel('ves_brand/group')->load((int) $filter_group); } $collection->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->assign('brands', $collection); $this->assign('resroute', $resroute); return parent::_toHtml(); }