3

I need to duplicate the check payment method and I've followed this guidelines: http://www.magentocommerce.com/wiki/duplicating_money_order_payment_method_module

Everything works as expected but I had to modify core files as the guide stated and I want the website to be able to be updated without breaking this.

I had to edit for this the app/core/Mage/Payment files that follow:

-etc/config.xml -etc/system.xml

and added copies of the checkmo.php files where they were needed.

I tried to replicate these changes inside app/code/local/Mage/Payment but with the same code I can't see the payment method now. I'm guessing this is not the right way to do this. How can it be done?

5

You need to create your own payment module which essentially replicates what Mage_Payment is doing. Where it makes sense, extend the classes in Mage_Payment with your own similar versions of them. Yes, what I'm saying is don't follow that example from the wiki and do this the correct way, go the extra mile and don't try to shortcut it by hacking it into the Mage_Payment module.

The reason what you are doing will not work from app/code/local/ is because the etc/*.xml files are only loaded from the code pool which the module tells the system it is found in. I.e. the PHP include path based fallback scheme does not apply to xml files.

  • 1
    Aha, so I need to create a module with it's own xml files I guess? I have seen that not all modules are created the same way, can you point me in the right direction to make this one? – Elaine Marley Jul 24 '13 at 18:37
  • 1
    To learn the basics, check out this tutorial (not reviewed for technical accuracy, but at a glance, it looks helpful) and I'd also recommend running through the free Quick Start to Magento Customization Training Series by Magento. These will give you a real good idea of how to bootstrap your module, then all that's left is mimicking what you've found in the Mage_Payment module inside of your own. – davidalger Jul 25 '13 at 2:29

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.