0

I am working on an extension. On setting up the configuration options, I am getting error while trying to fetch options for my select variable.

My System.xml

    <?xml version="1.0"?>
<config>
    <sections>
        <checkout  translate="label" module="orderid">            
            <groups>
                <ci_orderid translate="label"> 
                    <label>Custom Order Id</label>
                    <frontend_type>text</frontend_type>
                    <sort_order>0</sort_order>
                    <show_in_default>1</show_in_default>
                    <show_in_website>1</show_in_website>
                    <show_in_store>1</show_in_store>
                    <fields>
                        <ci_orderid_active translate="label">
                            <label>Enable</label>
                            <frontend_type>select</frontend_type>
                            <source_model>adminhtml/system_config_source_yesno</source_model>
                            <sort_order>0</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>1</show_in_store>
                        </ci_orderid_active>

                        <ci_orderid_payment translate="label">
                            <label>Payment Gateway</label>
                            <frontend_type>select</frontend_type>
                            <source_model>CI_OrderId/Gateway</source_model>
                            <sort_order>0</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>1</show_in_store>
                        </ci_orderid_payment>
                    </fields>
                </ci_orderid>
            </groups>
        </checkout>
    </sections>
</config>

On loading the configuration I am getting blank screen and an error is showing on system log file. Error:

2015-03-18T07:15:50+00:00 ERR (3): Warning: include(Mage/CI/OrderId/Model/Gateway.php): failed to open stream: No such file or directory  in /var/www/html/m18/lib/Varien/Autoload.php on line 93
2015-03-18T07:15:50+00:00 ERR (3): Warning: include(): Failed opening 'Mage/CI/OrderId/Model/Gateway.php' for inclusion (include_path='/var/www/html/m18/app/code/local:/var/www/html/m18/app/code/community:/var/www/html/m18/app/code/core:/var/www/html/m18/lib:.:/usr/share/php:/usr/share/pear')  in /var/www/html/m18/lib/Varien/Autoload.php on line 93

Gateway.php(Model/Gateway.php)

class CI_OrderId_Model_Gateway {
    public function getActivePaymentMethods() {
        $methods = array(array('value'=>'', 'label'=>Mage::helper('adminhtml')->__('--Please Select--')));
        return $methods;

    }
}

Config.xml File

<?xml version="1.0"?>
<config>
  <modules>
    <CI_OrderId>
      <version>0.1.0</version>
    </CI_OrderId>
  </modules>
  <global>
    <helpers>
      <orderid>
        <class>CI_OrderId_Helper</class>
      </orderid>
    </helpers>
    <models>
      <orderid>
        <class>CI_OrderId_Model</class>
      </orderid>
    </models>
  </global>
</config>

It is showing like, system cannot locate my class. Please help me! Thanks!

  • can you show Gateway.php? – ND17 Mar 18 '15 at 7:41
  • Post updated with the code. Please check. – Anish Karim Mar 18 '15 at 7:48
  • Can you also show the config.XML? – Martijn Schot Mar 18 '15 at 7:48
  • config.xml added in the post. – Anish Karim Mar 18 '15 at 7:55
1

Replace this:

<source_model>CI_OrderId/Gateway</source_model>

With:

<source_model>ci_orderid/gateway</source_model>

add this in Config.xml

<adminhtml>
    <acl>
                <resources>
                    <all>
                        <title>Allow Everything</title>
                    </all>
                    <admin>
                        <children>
                            <system>
                                <children>
                                    <config>
                                        <children>
                                            <ci_orderid translate="title" module="ci_orderid">
                                                <title>CI OrderId</title>
                                                <sort_order>10000</sort_order>
                                            </ci_orderid>
                                        </children>
                                    </config>
                                </children>
                            </system>
                        </children>
                    </admin>
                </resources>
            </acl>
</adminhtml>

Hope this will help you

  • It was like that before. I changed it on getting the error. – Anish Karim Mar 18 '15 at 7:51
  • See my update answer – ND17 Mar 18 '15 at 8:03
  • I am still having the error. I am able to see the configuration settings on commenting out the "ci_orderid_payment" part in system.xml Thanks. – Anish Karim Mar 18 '15 at 8:09
  • I think just adding orderid/gateway will do the trick reading the config. – Jeroen Mar 19 '15 at 22:19

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.