Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

How to use layered navigation with custom product lists
 
PavelPolyakov
Sr. Member
 
Total Posts:  98
Joined:  2009-08-17
 

Hello, I have a question.

How I sould build by custom product list to make layered navigation work for it.

Now I get my products collection that way:

public function _getProductCollection()
    
{
        $visibility 
= array(
                      
Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH,
                      
Mage_Catalog_Model_Product_Visibility::VISIBILITY_IN_CATALOG
                  
);
        
        
$storeId Mage::app()->getStore()->getId();
        
        
$layer Mage::getSingleton('catalog/layer');
    
        
$_productCollection Mage::getResourceModel('catalog/product_collection')
                                      ->
addAttributeToSelect('*')
                                      ->
addAttributeToFilter('visibility',$visibility)
                                      ->
setPage($this->getToolbarBlock()->getCurrentPage(), $this->getToolbarBlock()->getLimit())
                                      ->
addAttributeToFilter('news_from_date',array('lt'=>date('Y-m-d H:i:s')))
                                      ->
addAttributeToFilter('news_to_date', array('gt'=>date('Y-m-d H:i:s')));

  
        
$products=$_productCollection->getItems(); 
        
        
$this->count=count($_productCollection);
        
        
$this->_productCollection=$_productCollection;
        
        return 
$this->_productCollection;
}

and I’m updating layout with this code:

<reference name="left">
                  <
block type="catalog/layer_view" name="catalog.leftnav" after="catalog.category-nav" template="catalog/layer/view.phtml"/>
</
reference>

Layered navigation is shown for price field only. And it isn’t works (but I don’t expect it to work without changes in code).

So, could someone help me with the direction? How can I connect my custom product list with the layered navigation?

Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
PavelPolyakov
Sr. Member
 
Total Posts:  98
Joined:  2009-08-17
 

Still interesting

 
Magento Community Magento Community
Magento Community
Magento Community
 
PavelPolyakov
Sr. Member
 
Total Posts:  98
Joined:  2009-08-17
 

Another try, who will point a direction .... ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
PavelPolyakov
Sr. Member
 
Total Posts:  98
Joined:  2009-08-17
 

If someone is interesting, here is another variant of this question: http://magentoexpert.com/how-to-use-layered-navigation-with-custom-product-lists/ (even 1 answer is present there)

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top