Paramjit Paramjit - 5 months ago 33
PHP Question

404 error in magento module

i new in magento

add column or field in customer group using module and another module as like as product with add, edit or delete option

i search for this but doesn't find the specific answer how to done this with module because all answer about edit the magento inbuilt files

so Please tell me how to create a module which add a field in customer group at admin panel, store the value and how to retrive this value at frontend using php

i try to make a module and here my files are

app/code/local/super/awesome/

etc/config.xml

<config>
<modules>
<Super_Awesome>
<version>0.1.0</version>
</Super_Awesome>
</modules>
<adminhtml>
<!-- The <layout> updates allow us to define our block layouts in a seperate file so are aren't messin' with the magento layout files. -->
<layout>
<updates>
<awesome>
<file>awesome.xml</file>
</awesome>
</updates>
</layout>
<!-- The <acl> section is for access control. Here we define the pieces where access can be controlled within a role. -->
<acl>
<resources>
<admin>
<children>
<awesome>
<title>Awesome Menu Item</title>
<children>
<example translate="title" module="awesome">
<title>Example Menu Item</title>
</example>
</children>
</awesome>
</children>
</admin>
</resources>
</acl>
</adminhtml>
<admin>
<!--
Here we are telling the Magento router to look for the controllers in the Super_Awesome_controllers_Adminhtml before we look in the
Mage_Adminhtml module for all urls that begin with /admin/controller_name
-->
<routers>
<adminhtml>
<args>
<modules>
<awesome before="Mage_Adminhtml">Super_Awesome_Adminhtml</awesome>
</modules>
</args>
</adminhtml>
</routers>
</admin>

<global>
<models>
<awesome>
<class>Super_Awesome_Model</class>
<resourceModel>awesome_mysql4</resourceModel>
</awesome>
<awesome_mysql4>
<class>Super_Awesome_Model_Mysql4</class>
<entities>
<example>
<table>Super_Awesome_example</table>
</example>
</entities>
</awesome_mysql4>
</models>

<resources>
<awesome_setup>
<setup>
<module>Super_Awesome</module>
</setup>
<connection>
<use>core_setup</use>
</connection>
</awesome_setup>
<awesome_write>
<connection>
<use>core_write</use>
</connection>
</awesome_write>
<awesome_read>
<connection>
<use>core_read</use>
</connection>
</awesome_read>
</resources>

<blocks>
<awesome>
<class>Super_Awesome_Block</class>
</awesome>
</blocks>
<helpers>
<awesome>
<class>Super_Awesome_Helper</class>
</awesome>
</helpers>
</global>




etc/adminhtml.xml

<config>
<menu>
<awesome translate="title" module="awesome">
<title>Awesome</title>
<sort_order>15</sort_order>
<children>
<example translate="title" module="awesome">
<title>Example</title>
<sort_order>1</sort_order>
<action>adminhtml/example/index</action>
</example>
</children>
</awesome>
</menu>




Helper/Data.php

class Super_Awesome_Helper_Data extends Mage_Core_Helper_Abstract{}


sql/awesome_setup/mysql4-install-0.1.0.php

$installer = $this;$installer->startSetup();$installer->run("");$installer->endSetup();


Please tell me next steps for the module

Please help me, and thanks

Answer
  • Logout/login again
  • Make sure you have ACL defined for the menu items in the XML config of your module.

Your menu in config should look like this

<menu>
    <custommodule translate="title" module="custommodule">
        <title>Custom Module</title>
        <sort_order>100</sort_order>
        <children>
            <custommodule translate="title" module="custommodule">
                <title>Custom Module</title>
                <sort_order>101</sort_order>
                <children>
                    <custommodule1 translate="title" module="custommodule">
                        <title>Custom Module1</title>
                        <action>custommodule/adminhtml_event</action>
                        <sort_order>102</sort_order>
                    </custommodule1>

                </children>
            </custommodule>
        </children>
    </custommodule>
</menu>

And ACL in config.xml ( or admintml ) should look like this:

<acl>
    <resources>
        <all>
            <title>Allow Everything</title>
        </all>
        <admin>

            <children>
                <custommodule translate="title" module="custommodule">
                    <title>Custom Module</title>
                    <sort_order>100</sort_order>

                    <children>
                        <custommodule translate="title">
                            <title>Custom Module</title>
                            <sort_order>101</sort_order>
                            <children>
                                <custommodule1 translate="title" module="custommodule">
                                    <title>Custom Module1</title>
                                </custommodule1>

                            </children>
                        </custommodule>
                    </children>
                </custommodule>

            </children>
        </admin>
    </resources>
</acl>
Comments