4

I am using magento 1.7.2 version i am working on payment gateway a strange problem. please help me to out this problem here is following my config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Infeenty_InfeentyInvoice>
            <version>1.0.0</version>
        </Infeenty_InfeentyInvoice>
    </modules>
    <global>
        <models>
            <infeentyinvoice>
                <class>Infeenty_InfeentyInvoice_Model</class>
            </infeentyinvoice>
        </models>
        <resources>
            <infeentyinvoice_setup>
                <setup>
                    <module>Infeenty_InfeentyInvoice</module>
                    <class>Mage_Eav_Model_Entity_Setup</class>
                </setup>
                <connection>
                    <use>core_setup</use>
                </connection>
            </infeentyinvoice_setup>
            <infeentyinvoice_read>
                <connection>
                    <use>core_read</use>
                </connection>
            </infeentyinvoice_read>
            <infeentyinvoice_write>
                <connection>
                    <use>core_write</use>
                </connection>
            </infeentyinvoice_write>
        </resources>
        <blocks>
            <infeentyinvoice>
                <class>Infeenty_InfeentyInvoice_Block</class>
            </infeentyinvoice>
        </blocks>
        <helpers>
            <infeentyinvoice>
                <class>Infeenty_InfeentyInvoice_Helper</class>
            </infeentyinvoice>
        </helpers>
   </global>
   <default>
        <payment>
            <infeentyinvoice>
                <model>infeentyinvoice/infeentyinvoice</model>
                <countries>SE,DE,NL</countries>
                <order_status>pending</order_status>
                <title>Infeenty Invoice</title>
                <active>1</active>
                <payment_action>authorize</payment_action>
            </infeentyinvoice>
        </payment>
        <payment_action>authorize</payment_action>
    </default>
    <adminhtml>
        <translate>
            <modules>
                <Infeenty_InfeentyInvoice>
                    <files>
                        <default>Infeenty_InfeentyInvoice.csv</default>
                    </files>
                </Infeenty_InfeentyInvoice>
            </modules>
        </translate>
    </adminhtml>
    <frontend>
        <routers>
            <infeentyinvoice>
                <use>standard</use>
                <args>
                    <module>Infeenty_InfeentyInvoice</module>
                    <frontname>infeentyinvoice</frontname>
                </args>
            </infeentyinvoice>
        </routers>
        <translate>
            <modules>
                <Infeenty_InfeentyInvoice>
                    <files>
                        <default>Infeenty_InfeentyInvoice.csv</default>
                    </files>
                </Infeenty_InfeentyInvoice>
            </modules>
        </translate>
    </frontend>
</config>

strange issue might be did something wrong in this xml when i use $this->getLayout()->createBlock('infeentyinvoice/form') then its always return false

i have create block file Form.php under Infeenty/InfeentyInvoice/Block and class is Infeenty_InfeentyInvoice_Block_Form but still i am not getting this block work

2
  • 2
    Do you have the file app/etc/modules/Infeenty_InfeentyInvoice.xml? Did you clear the cache after creating the module? Commented May 30, 2013 at 6:53
  • yes i have file in this location Commented May 30, 2013 at 13:24

2 Answers 2

19

This looks correct. Troubleshooting steps, in order; do each one independently:

  1. Clear cache. Disable compiler.
  2. var_dump(Mage::getConfig()->getBlockClassName('infeentyinvoice/form')); - If this returns "Mage_Infeentyinvoice_Block_Form", your module config XML is not being merged:
    • Enable developer mode (Mage::setIsDeveloperMode(true)) and PHP error display, and break your config.xml file to confirm ~~it's being merged~~ that the configuration XML is being compiled without error.
    • Once this is returning the expected classname,
  3. var_dump(mageFindClassFile('Infeenty_InfeentyInvoice_Block_Form')); - if this returns false, there is a problem with the path, syntax, or with file permissions.
    • Fix path / syntax / file permissions
  4. new Infeenty_InfeentyInvoice_Block_Form; - if this returns false or some error, there is an issue with class definition.
0
echo $this->getLayout()->createBlock('infeentyinvoice/form')->toHtml();

If you want to set a template use this

echo $this->getLayout()->createBlock('infeentyinvoice/form')->setTemplate('pathtotemplatefile/filename.phtml')->toHtml();
2
  • no its generating fatel error $this->getLayout()->createBlock('infeentyinvoice/form') return false so we can't call function Commented May 30, 2013 at 6:38
  • if you can post the error somebody will be able to help you.and i will tell you to check whether your block is working with minimal xml configuration to get blocks working. so you will get a better idea Commented May 30, 2013 at 10:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.