protected function _prepareCollection()
 {
     parent::_prepareCollection();
     if ($this->used_store_id === false) {
         $theme_id = (int) Mage::app()->getRequest()->getParam('theme_id');
         $theme_config_data = Mage::getModel('thememanager/themes')->load($theme_id);
         $store_id = $theme_config_data->getStoreId();
     } else {
         $store_id = (int) $this->used_store_id;
     }
     $collection = $this->getCollection()->addStoreFilter($store_id);
     $this->setCollection($collection);
 }
Esempio n. 2
0
 protected function _prepareCollection()
 {
     $store = $this->getWebsite();
     $collection = Mage::getModel('cms/page')->getCollection();
     $query_id = $this->getRequest()->getParam('id', null);
     if ($query_id) {
         $query_sku_table = Mage::getSingleton('core/resource')->getTableName('rocketweb_search/query_sku');
         $collection->getSelect()->joinLeft(array('query_sku' => $query_sku_table), 'main_table.page_id = query_sku.entity_id AND query_sku.query_id = ' . $query_id, array('position' => 'order'));
     }
     if ($store->getId()) {
         $collection->addStoreFilter($store);
     }
     $collection->addFieldToFilter('is_active', 1);
     $this->setCollection($collection);
     parent::_prepareCollection();
     return $this;
 }