0

I am trying to override the poll extension of magento but the override that i am doing is not working. My purpose is when someone complete's the poll to redirect him into a different url, instead of seeing the poll results.

So here you can see my folder structure http://prntscr.com/g5rz6w

Config.xml

<config>
<frontend>
    <routers>
        <poll>
            <args>
                <module>
                  <Poll_MF_module before="Mage_Poll">Poll_MF_module_Poll</Poll_MF_module>
                </module>
            </args>
        </poll>
    </routers>
</frontend>

VoteController.php

    require_once('Mage/Poll/controllers/VoteController.php');

class Poll_MF_Module_VoteController extends Mage_Core_Controller_Front_Action {
        die ('vote is dead');
    }

and inside the app/etc/modules/Poll_MF_Module.xml

<config>
    <modules>
        <Poll_MF_module>
            <active>true</active>
            <codePool>local</codePool>
        </Poll_MF_module>
    </modules>
</config>

What am i doing wrong ?

1

Update your module name from Poll_MF_module to Poll_Mf

app/code/local/Poll/Mf/etc/config.xml and not Config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Poll_Mf>
            <version>0.1.0</version>
        </Poll_Mf>
    </modules>
    <frontend>
        <routers>
            <poll>
                <args>
                    <modules>
                        <poll_mf before="Mage_Poll">Poll_Mf</poll_mf>
                    </modules>
                </args>
            </poll>
        </routers>
    </frontend>
</config>

app/code/local/Poll/Mf/controllers/VoteController.php

require_once 'Mage/Poll/controllers/VoteController.php' ;

//here you extends the controller that you want to rewritte and not the natif one

class Poll_Mf_VoteController extends Mage_Poll_VoteController
{ 
    public function nameAction()
    {
        die ('vote is dead');
    } 
}

app/etc/modules/Poll_Mf.xml

<config>
    <modules>
        <Poll_Mf>
            <active>true</active>
            <codePool>local</codePool>
        </Poll_Mf>
    </modules>
</config>
  • Hi, i did your suggestions but it's not working. – ebabis Aug 8 '17 at 9:25
  • I updated my answer, look again, it should work – PЯINCƏ Aug 8 '17 at 9:25
  • No it's not working. The poll is loaded normally in my page and works. – ebabis Aug 8 '17 at 9:40
  • the answer that i gave you is correct, check your module files and of the extention too – PЯINCƏ Aug 8 '17 at 9:44
  • I am loading the the above files into app/code/local/Poll_mf and not in app/code/local/Mage/Poll_Mf is that correct? – ebabis Aug 8 '17 at 9:48

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.