1

for some reason the Compare controller override doesn't work for me, I tried about everything I could find, but it just doesn't happen and I am running out of ideas. Do you see anything I am doing wrong?

etc/modules/Unirack_CatalogExtended.xml :

<?xml version="1.0"?>
<config>
    <modules>
        <Unirack_CatalogExtended>
            <active>true</active>
            <codepool>local</codepool>
        </Unirack_CatalogExtended>
    </modules>
</config>

(but I see the module in Admin > Configuration > Advanced, so I reckon it is registered correctly)

code/local/Unirack/CatalogExtended/etc/config.xml :

<?xml version="1.0"?>
<config>
    <modules>
        <Unirack_CatalogExtended>
            <version>0.1.0</version>
        </Unirack_CatalogExtended>
    </modules>
    <frontend>
        <routers>
            <catalog>
                <args>
                    <modules>
                        <Unirack_CatalogExtended before="Mage_Catalog">Unirack_CatalogExtended</Unirack_CatalogExtended>
                    </modules>
                </args>
            </catalog>
        </routers>
    </frontend>
</config>

code/local/Unirack/CatalogExtended/controllers/Product/CompareController.php :

<?php
require_once Mage::getModuleDir('controllers', 'Mage_Catalog').DS.'Product'.DS.'CompareController.php';

class Unirack_CatalogExtended_Product_CompareController extends Mage_Catalog_Product_CompareController
{
    public function indexAction()
    {
        die('overriden'); // never happens
    }
}

Even if I put die(); statement at the beginning of my custom CompareController.php, it doesn't happen, the file is just not loaded at all. So I reckon it must be somewhere in the config.xml where I register it, or in paths structure, but I've already checked all this several times and just cannot find anything. Sometimes Magento can really be frustrating :/

1

All good, except <codepool>local</codepool> should be <codePool>local</codePool>

  • You are my hero, indeed that was it, thanks a lot. Still I don't get why is Magento so sensitive about case in XMLs.. well I will certainly remember this one. – Ziki Feb 9 at 4:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.