3
votes

I want to override the controller: "ProductController" from Mage/Catalog.

Namespace: Ziny

Module: AutomaBrasil

My module is on local folder.

Resources like Helpers, Models and Blocks, I override without errors; but controllers I can't.

Ziny/AutomaBrasil/etc/modules/Ziny_AutomaBrasil.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Ziny_AutomaBrasil>
            <active>true</active>
            <codePool>local</codePool>
        </Ziny_AutomaBrasil>
    </modules>
</config>

Ziny/AutomaBrasil/code/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Ziny_AutomaBrasil>
            <version>0.1.0</version>
        </Ziny_AutomaBrasil>
    </modules>
    <frontend>
        <routers>
            <automabrasil>
                <use>standard</use>
                <args>
                    <module>Ziny_AutomaBrasil</module>
                    <frontName>automabrasil</frontName>
                </args>
            </automabrasil>
            <catalog>
                <args>
                    <modules>
                        <automabrasil before="Mage_Catalog">Ziny_AutomaBrasil</automabrasil>
                    </modules>
                </args>
            </catalog>
        </routers>
    </frontend>
</config>

Ziny/AutomaBrasil/code/controllers/ProductController

<?php
require_once 'Mage/Catalog/controllers/ProductController.php';

class Ziny_AutomaBrasil_controllers_ProductController extends Mage_Catalog_ProductController
{
    public function viewAction()
    {
        die('Dark Souls');
    }
}

Nothing happens. The controller hasn't been overriden.

Someone knows what's wrong?

1
Are you using modman?Mukesh

1 Answers

4
votes

Change following in your code.

Ziny/AutomaBrasil/code/etc/config.xml

to

Ziny/AutomaBrasil/etc/config.xml

and

Ziny/AutomaBrasil/code/controllers/ProductController

to

Ziny/AutomaBrasil/controllers/ProductController

Update : I don't use modman but by searching on the modman commands on internet following should work for you to deploy.(Please comment if I am wrong.)

modman deploy Your_Extension_Path