I want to override block "upsell_products" in my custom module.
I've create a module "Parus_Upsell" with the files below. If the module is enable the block just disappears from product view page, but when is disabled the blocks shows normally. It looks like the rewrite works normally and magento can find the block (i tried to call new Parus_Upsell_Block_Upsell;
and var_dump(mageFindClassFile('Parus_Upsell_Block_Upsell'));
and var_dump(Mage::getConfig()->getBlockClassName('catalog/product_list_upsell'));
and it all works correctly returning my class name and correct paths. Moreover, if call print_r ($this->getSortedChildren());
from the theme view.phtml it returns all children blocks except "upsell_products" (if I disable the module, the block comes back to layout).
But if I in fact haven't overridden yet anything with the block class, why it doesn't show content from default block?
Magento version is 1.9.2
/app/code/local/Parus/Upsell/Block/Upsell.php
<?php
class Parus_Upsell_Block_Upsell extends Mage_Catalog_Block_Product_List_Upsell {
}
/app/code/local/Parus/Upsell/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<Parus_Upsell>
<version>0.1.0</version>
</Parus_Upsell>
</modules>
<global>
<blocks>
<parus_upsell>
<class>Parus_Upsell_Block</class>
</parus_upsell>
<catalog>
<rewrite>
<product_list_upsell>
Parus_Upsell_Block_Upsell
</product_list_upsell>
</rewrite>
</catalog>
</blocks>
<helpers>
<parus_upsell>
<class>Parus_Upsell_Helper</class>
</parus_upsell>
</helpers>
</global>
</config>
/app/etc/modules/Parus_Upsell.xml
<?xml version="1.0"?>
<config>
<modules>
<Parus_Upsell>
<active>active</active>
<codePool>local</codePool>
</Parus_Upsell>
</modules>
</config>