0

I installed the last version available of Magento 1.9.2.1. I try to access the payment methods tab as an admin and I have this error:

Fatal error: Call to a member function setAllowedTypes() on a non-object in C:\wamp\www\magentomerchant\app\code\core\Mage\Paypal\Model\Config.php on line 1092

I did not modify any of the core modules of magento. Any explanations ?

enter image description here

Thank you

Edit:

It seems that as soon as I add a new module I have this error. This is its config.xml

0.1.0

  <frontend>
    <routers>
        <payment>
            <use>standard</use>
            <args>
                <module>Merchant_Payment</module>
                <frontName>payment</frontName>
            </args>
        </payment>
    </routers>
    <layout>
        <updates>
            <payment>
                <file>payment.xml</file>
            </payment>
        </updates>
    </layout>
</frontend>

<global>
    <blocks>
        <payment>
            <class>Merchant_Payment_Block</class>
        </payment>
    </blocks>


    <models>
        <payment>
            <class>Merchant_Payment_Model</class>
            <resourceModel>payment_mysql4</resourceModel>
        </payment>
        <payment_mysql4>
            <class>Merchant_Payment_Model_Mysql4</class>
            <entities>

                <payment>
                    <table>transaction_test</table>
                </payment>

                <magentoservice>
                    <table>magento_service</table>
                </magentoservice>

                <magentotransaction>
                    <table>magento_transaction</table>
                </magentotransaction>

            </entities>
        </payment_mysql4>
     </models>
    <!-- Fin Déclaration model -->
    <resources>
        <payment_write>
            <connection>
                <use>core_write</use>
            </connection>
        </payment_write>
        <payment_read>
            <connection>
                <use>core_read</use>
            </connection>
        </payment_read>
    </resources>
</global>

<admin>
    <routers>
        <payment>
            <use>admin</use>>
            <args>
                <module>Merchant_Payment</module>
                <frontName>payment</frontName>
            </args>
        </payment>
    </routers>
</admin>

  • Make sure you have Mage_Payment_Model_Source_Cctype class exist. Check file app\code\core\Mage\Payment\Model\Source\Cctype.php – Akhilesh Patel Sep 30 '15 at 16:31
  • Indeed, I just checked and it does exist – Khaled Ben Ali Sep 30 '15 at 16:37
  • It might be possible some files are missing in your setup. restore your core files if you have fresh setup. – Akhilesh Patel Sep 30 '15 at 17:00
  • I removed a new module that I added and also restored the initial config and now it works fine. I do not know what's wrong with the stuff that I added. As soon I find I post it. Thank you – Khaled Ben Ali Sep 30 '15 at 17:04
  • It seems that as soon as I add a new module I have this error. I added its config.xml file in the post – Khaled Ben Ali Sep 30 '15 at 17:28
0

Issue is with your model class declaration

<models>
        <payment>
            <class>Merchant_Payment_Model</class>
            <resourceModel>payment_mysql4</resourceModel>
        </payment>
      ..........

change it to

<models>
            <merchant_payment>
                <class>Merchant_Payment_Model</class>
                <resourceModel>payment_mysql4</resourceModel>
            </merchant_payment>
......

And it should work.

  • It works fine. Thanks. What was wrong with this decleration ? Because the module works fine when I acces the url that I defined for the front end but I have a problem only when I try to acces the payment methods tab in the admin panel. – Khaled Ben Ali Sep 30 '15 at 18:00

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.