Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Mage_CatalogSearch_Block_Result:_getProductCollection()
- protected function _getProductCollection()
- {
- if (is_null($this->_productCollection)) {
- $this->_productCollection = $this->getListBlock()->getLoadedProductCollection();
- }
- $activeCategories = Mage::getResourceModel('catalog/category_collection')
- ->addAttributeToFilter('is_active', 1)
- ->getColumnValues('entity_id');
- $this->_productCollection->joinField(
- 'category_id', 'catalog/category_product', 'category_id',
- 'product_id = entity_id', null, 'left'
- )
- ->addAttributeToSelect('*')
- ->addAttributeToFilter('category_id', array(
- array('in' => $activeCategories),
- ));
- $this->_productCollection->getSelect()->group('entity_id');
- // echo "<pre>";
- // print_r($this->_productCollection->getData());
- // die;
- return $this->_productCollection;
- }
Add Comment
Please, Sign In to add comment