0
votes

Sorry to interrupt you, but have looked at this problem for some time now, and i am getting very frustrated.

I have made a Module to rewrite Mage_Core_Catalog_Block_Product_View_Type_Configurable, where i want to change the getJSConfig method.

class DennisKirkebak_ConfigurableStock_Block_Product_View_Type_Configurable extends Mage_Catalog_Block_Product_View_Type_Configurable

This is my Configurable.php class, which i have putted in DennisKirkebak/Catalog/Block/Product/View/Type/ :

My config.xml file looks like this:

<?xml version="1.0"?>
<config>
<modules>
    <denniskirkebak_catalog>
        <version>1.0.1</version>
    </denniskirkebak_catalog>
</modules>
<global>
    <blocks>
        <catalog>
            <rewrite>
                <product_view_type_configurable>
                    DennisKirkebak_Catalog_Block_Product_View_Type_Configurable
                </product_view_type_configurable>
            </rewrite>
        </catalog>
    </blocks>
</global>
</config>

I have made my Module active in the app/code/etc/modules/ where i have a file called DennisKirkebak_All.xml and I can see my module in the backend of Magento.

Can someone please give me a idea to how I solve this problem?

2

2 Answers

0
votes

Try doing a var_dump() on this in some random template you know will get outputted:

Mage::getConfig()->getNode('global/blocks/catalog/rewrite/product_view_type_configurable');

I'm not completely sure about that last part, if you're supposed to keep is as underscored or possibly separate it with slashes - but you get the point. It will show you any active overrides at runtime, and let you know if there's some existing module that is already overriding the same block.

0
votes

Your block class names do not match up. Replace the part in your config.xml with this:

<product_view_type_configurable>DennisKirkebak_ConfigurableStock_Block_Product_View_Type_Configurable</product_view_type_configurable>

Also I've noticed Magento sometimes behaves funny when you wrap the lines in your xml files, so try to keep it on one line