Magento 1.9 – How to Create Custom Module

extensionsmagento-1.9module

Hi i created custom module with this structure :

enter image description here

Config file code in etc/config.xml

<config>
    <modules>
        <Shareino_Sync>
            <version>0.1.0</version>
        </Shareino_Sync>
    </modules>
    <frontend>
        <routers>
            <sync>
                <use>standard</use>
                <args>
                    <module>Shareino_Sync</module>
                    <frontName>sync</frontName>
                </args>
            </sync>
        </routers>
    </frontend>

</config>

app/etc/modules/Shareino_Sync.xml

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

And i just created controller like this :
app/code/community/Shareino/Sync/controllers/IndexController

class Shareino_Sync_IndexController extends Mage_Core_Controller_Front_Action
{
    public function indexAction(){
        echo "index Action";
    }
    public function testAction(){
        echo "index Action";
    }

}

Always I try to open index action i got 404 error.

Best Answer

The simple thing your issue at codePool.

You declare Shareino_Sync module's codePool is local at Shareino_Sync.xml .

But as per as, your code your module it located at community codePool (app/code/community).

So you should change

  <codePool>local</codePool>

To

  <codePool>community</codePool>
Related Topic