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

Product list and Layer filter. 
 
mchwedkowski
Jr. Member
 
Total Posts:  1
Joined:  2011-02-24
 

Hi,

i have a problem with customizing product listing (which is filter by layer nav filter). I spend a couple days googleing that problem and I haven’t found anything which could help me.

I need two separated objects of productCollection in Catalog/Block/Product/List.php lets say in _beforeToHtml method.

But i can’t reach that because:

$collection $this->_getProductCollection();
$collection_copy = clone $collection;

$collection ->addAttributeToFilter('some_attr', array(
   
'eq' => somevalue
));

the problem is that the addAttributeToFilter is also set for $collection_copy :(.

I need two separated $collections because i need find two specific products “take them” and remove from main collection.

Both actions need to be done on filtered (layer) collections.

Thank for Your time.

Michał Chwedkowski

 
Magento Community Magento Community
Magento Community
Magento Community
 
Siggi_Schmitz
Enthusiast
 
Avatar
Total Posts:  811
Joined:  2011-07-03
 

Not tested, but maybe you can use the clear method:

$collection_copy->clear();
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top