Magento – Rewrite catalog/image helper function for all pages but subcategory_listing

cataloghelperimagemagento-1.7overrides

I am using a third party module which is rewriting catalog/image helper function for product images.

<global>
        <models>
            <pio>
                <class>Kadro_PIO_Model</class>
            </pio>
            <catalog>
                <rewrite>
                    <product_image>Kadro_PIO_Model_Product_Image</product_image>
                </rewrite>
            </catalog>
        </models>

Is it possible to disable this Extension/overwrite for catalog/navigation/subcategory_listing.phtml only so that there is used the standard Magento category/image function?

Best Answer

The answer is obviously, Yes, You Can. :)

If you disable this third party extension either via editing code or via admin, then magento will start to use its default helper/Model class. Yes Magento is smart enough to to do that.

In order to disable this extension via admin, you need to go

System  >  Configuration  > Advanced

In order to disable via xml file, you need to find activation file of the extension. Most probably it's name would be Kadro_PIO.xml. So go to app\etc\modules\Kadro_PIO.xml and then change

 <active>false</active>

Edit

From your comment, it seems that, the extension do other jobs for you. So my solution will not help you, since it disable that extension fully.

If you just need to avoid the rewrite part, then the fastest and easiest way will be comment out that rewrite part in the extension's config.xml file.

But this is not the proper way to do this. If you need to do this in clear way, then I will suggest you to create a small custom module that will rewrite the extension's rewrite model file.

For this your module config.xml should holds this part

File : app\code\local\Namespace\Modulename\etc\config.xml

<global>
      <models>
           <pio>
                <rewrite>
                    <product_image>Namespace_Modulename_Model_Product_Image</product_image>
                </rewrite>
            </pio>
     </models>
</globlal>

File : app\code\local\Namespace\Modulename\Model\Product\Image.php

<?php
class Namespace_Modulename_Model_Product_Image extends Kadro_PIO_Model_Product_Image
{
    //here you can overwrite any method that extension uses
}