1

I am creating shipping module. Here I am trying to add input box from block, Which I have created here

app/code/local/Namespace/module/Block/System/Config/Form/Field/Fieldtype.php

class Namespace_Module_Block_System_Config_Form_Field_Fieldtype extends Mage_Adminhtml_Block_System_Config_Form_Field {

    protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) {
        $key = 1;
       $value="test";
        $input = '<input id="module_fieldtype_'.$key.'" name="groups[module][fields][fieldtype][value]['.$key.']" value="'.$value.'" class=" input-text" type="text">';
        return $input;
    }
}

And at app/code/local/Namespace/Module/etc/system.xml

<fieldtype translate="label">
    <label>Multipliers</label>
<frontend_model>namespace_module/system_config_form_field_fieldtype</frontend_model>
                            <sort_order>170</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>0</show_in_website>
                            <show_in_store>0</show_in_store>
                            <can_be_empty>1</can_be_empty>
                        </fieldtype>

And at app/code/local/Namespace/Module/etc/config.xml

< config>
    < modules>
        < Namespace_Module>
            <version>0.1.0</version>
        </Namespace_Module>
    </modules>
    <global>
        <models>
            < namespace_module>
                <class>Namespace_Module_Model</class>
            </ namespace_module>
        </models>
        < helpers>
            <namespace_module>
                <class>Namespace_Module_Helper</class>
            </namespace_module>
        </helpers>
    </global>
    <default>
        < carriers>
            < namespace_module>
                <active>1</active>
                <sort_order>1</sort_order>
                <model>namespace_module/carrier</model>
                <title>Namespace Module Carrier</title>
                <sallowspecific>0</sallowspecific>
                <express_max_weight>1</express_max_weight>
            </ namespace_module>
        </ carriers>
    </ default>
</ config>

now when I refreshed page, it is giving me error

Fatal error: Class 'Mage_Namespace_Module_Block_System_Config_Form_Field_fieldtype' not found

Can anyone guide where I have mistaken or what is missing !!!

johnwright121
  • 79
  • 2
  • 9

1 Answers1

0

Use this in system.xml

<fieldtype translate="label">
    <label>Multipliers</label>
<frontend_model>Namespace_Module_Block_System_Config_Form_Field_Fieldtype</frontend_model>
                            <sort_order>170</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>0</show_in_website>
                            <show_in_store>0</show_in_store>
                            <can_be_empty>1</can_be_empty>
                        </fieldtype>
Harish Kumar
  • 445
  • 4
  • 8
  • 16