0

i'm using Magento 1.9.0.1 and right now i am working on a new extension and i want to add new module with tab in the admin panel.

Here is what i've done so far:

/app/code/community/VivasIndustries/SmsNotification/etc/config.xml:

<?xml version="1.0"?>
<config>
  <modules>
    <VivasIndustries_SmsNotification>
      <version>0.1.0</version>
    </VivasIndustries_SmsNotification>
  </modules>
  <global>
    <models>
        <smsnotification>
            <class>VivasIndustries_SmsNotification_Model</class>
        </smsnotification>
    </models>  
    <events>
        <sales_order_save_after>
            <observers>
                <vivasindustries_smsnotification>
                    <class>smsnotification/observer</class>
                    <method>orderSaved</method>
                </vivasindustries_smsnotification>
            </observers>
        </sales_order_save_after>
    </events>
  </global>
  <adminhtml>
    <acl>
        <resources>
            <all>
                <title>Allow Everything</title>
            </all>
            <admin>
                <children>
                    <system>
                        <children>
                            <config>
                                <children>
                                    <vivas>
                                        <title>Vivas - All</title>
                                    </vivas>
                                </children>
                            </config>
                        </children>
                    </system>
                </children>
            </admin>
        </resources>
    </acl>
</adminhtml>
</config>  

Here is what i have in: /app/code/community/VivasIndustries/SmsNotification/etc/system.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <tabs>
        <vivas translate="label" module="vivasindustries_smsnotification">
            <label>Vivas Extensions</label>
            <sort_order>100</sort_order>
        </vivas>
    </tabs>
    <sections>
        <vivas translate="label" module="vivasindustries_smsnotification">
            <label>Extension Options</label>
            <tab>vivas</tab>
            <sort_order>1000</sort_order>
            <show_in_default>1</show_in_default>
            <show_in_website>1</show_in_website>
            <show_in_store>1</show_in_store>

            <groups>
                <vivas_group translate="label" module="vivasindustries_smsnotification">
                    <label>My Extension Options</label>
                    <frontend_type>text</frontend_type>
                    <sort_order>1000</sort_order>
                    <show_in_default>1</show_in_default>
                    <show_in_website>1</show_in_website>
                    <show_in_store>1</show_in_store>

                    <fields>
                        <vivas_input translate="label">
                            <label>My Input Field: </label>
                            <comment>My Comment</comment>
                            <frontend_type>text</frontend_type>
                            <sort_order>20</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>1</show_in_store>
                        </vivas_input>
                        <vivas_select translate="label">
                            <label>My Dropdown: </label>
                            <comment>Source model provider Magento's default Yes/No values</comment>
                            <frontend_type>select</frontend_type>
                            <sort_order>90</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>1</show_in_store>
                            <source_model>adminhtml/system_config_source_yesno</source_model>
                        </vivas_select>
                    </fields>
                </vivas_group>
            </groups>
        </vivas>
    </sections>
</config>

Here is what i have in: /app/code/community/VivasIndustries/SmsNotification/Helper/Data.php:

<?php
class VivasIndustries_SmsNotification_Helper_Data extends Mage_Core_Helper_Abstract 
{

}

With this done i receive the following error when i open my admin panel:

Fatal error: Class 'Mage_Vivasindustries_Smsnotification_Helper_Data' not found in /home/superweb/public_html/store/app/Mage.php on line 547

When i change the name of the FOLDER SmsNotification to Smsnotification this error is gone, but there is any new tab in the System->Configuration...

So guys can you help me out to create a new tab in the Admin panel ?

Thanks in advance!

1

You're missing your <helpers> node.

 <global>

 ...

     <helpers>
         <smsnotification>
             <class>VivasIndustries_SmsNotification_Helper</class>
         </smsnotification>
     </helpers>

 ...

 </global>
0

The Lex,You need define the helper class of your module.You need define helper at config.xml

 <helpers>
         <vivasindustries_smsnotification>
             <class>VivasIndustries_SmsNotification_Helper</class>
         </vivasindustries_smsnotification>
     </helpers>

under global tag

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.