bySebastian
bySebastian

Reputation: 71

Magento Action Controller going to 404

For a custom module I created a new actioncontroller. But it doesn't execute. It's returns only a 404. I tried already some solutions from stackoverflow, but no one is working for me. :(

Urls I tried to call my action:

Can you take a look in my code? Maybe it's just a typo I didn't see.

Crmart/Medipim/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Crmart_Medipim>
            <version>0.1.0</version>
        </Crmart_Medipim>
    </modules>
    <frontend>
        <routers>
            <medipim>
                <use>standard</use>
                <args>
                    <module>Crmart_Medipim</module>
                    <frontName>medipim</frontName>
                </args>
            </medipim>
        </routers>
    </frontend>
</config>

Crmart/Medipim/controllers/SyncController.php

class Crmart_Medipim_SyncController extends Mage_Core_Controller_Front_Action
{

    public function indexAction()
    {
        $this->loadLayout();
        $this->renderLayout();
        //
        echo 'hello world!';
    }

    public function nowAction()
    {
        // ...
    }
}

app/etc/modules/Crmart_Medipim.xml

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

Upvotes: 0

Views: 955

Answers (2)

Plug-in files created correctly check once below steps for you plug-in works.

  1. Check that plugin is successfully registered or not form admin section Admin ->System->configuration->Advance check plugin is listed here

  2. open the app/etc/local.xml and check the below line <disable_local_modules>false</disable_local_modules> the value must be false otherwise plugin will not work

Upvotes: 0

bySebastian
bySebastian

Reputation: 71

Ok. Fixed! I had enabled to view storecodes in my url. So when I enter http://pharmaprofit.dev/nl/medipim/sync/now instead of http://pharmaprofit.dev/medipim/sync/now , it's working!

Upvotes: 1

Related Questions