I am trying to override core/catalog/block/product/List.php with following
Ref:http://www.magentocommerce.com/boards/viewthread/14692/
file: Ziva/Customcatalog/etc/config.xml
<config>
<modules>
<Ziva_CustomCatalog>
<version>1.0.0</version>
</Ziva_CustomCatalog>
</modules>
<global>
<blocks>
<catalog>
<class>Ziva_CustomCatalog_Block</class> <!--this is a new block page for that custom module-->
<rewrite>
<product_list>Ziva_Customcatalog_Block_Product_List</product_list>
</rewrite>
</catalog>
</blocks>
</global>
</config>
file: Ziva/Customcatalog/Block/Product/List.php
class Ziva_Customcatalog_Block_Product_List extends Mage_Catalog_Block_Product_List {
public function __construct() {
parent::__construct();
}
protected function _getProductCollection() { // trying to override this method
echo __CLASS__;
return parent::_getProductCollection();
}
public function holdthis() {
echo __METHOD__;
}
}
In exception log I am getting
exception 'Mage_Core_Exception' with message 'Invalid block type: Ziva_CustomCatalog_Block_Product_Compare_Sidebar' in C:\wamp\www\magento2\app\Mage.php:594
followed by
Invalid block type: Ziva_CustomCatalog_Block_Product_Price_Template
Invalid block type: Ziva_CustomCatalog_Block_Layer_View
Invalid block type: Ziva_CustomCatalog_Block_Category_View
Invalid block type: Ziva_CustomCatalog_Block_Product_List_Toolbar
And no products are displayed
EDIT:
I figured the problem
<class>Ziva_Customcatalog_Block</class>
Now I am rephrasing the question.
In a custom module you can only have one block class? But in core/catalog/block, we can see many.
catalog_block_product_list_collection
->setPageSize(10)
but it is not resetting the filters according to the loaded items. It is showing the original filters of the entire collection