I need to modify the product collection on category page. Therefore, I've modified the
_getProductCollection() in Mage/Catalog/Block/Product/List.php and added an additional filter
But this works only partly.
The product count in the top bar shows the correct product count (10) but Magento shows 12 products for this category.
printing the variables in catalog/product/list.phtml shows up following result:
$_productCollection=$this->getLoadedProductCollection(); echo $_productCollection->count() // 12 [wrong] echo $_productCollection->getSize() // 10 [correct] echo $_productCollection->getSelect() // Running in db: 10 [correct] iterating through the products with foreach ($_productCollection as $_product) shows 12 [wrong]
What am I doing wrong? Thanks!