Question

I am installing the RedSys module http://www.redsys.es following their guide. At some point of their guide they say the following:

4.Se deben colocar los ficheros de la carpeta “Source”, incluido en el módulo de pago de REDSYS, en el siguiente directorio del módulo de Magento: (TRANSLATION: The Source folder's files must be included in the following Magento's module directory:)

your_domain/magento/app/code/core/Mage/Adminhtml/Model/System/Config/Source

The thing is that they are writing new files in the core, so I wonder whether or not it would be the same if I write these files in local in the folder:

your_domain/magento/app/code/local/Mage/Adminhtml/Model/System/Config/Source

I ask this because I want to avoid problems in future Magento upgrades and I think that if they work the same way then the second approach would be better.

Était-ce utile?

La solution

Probably the first rule in Magento development : never touch the core

You can either:

  • create your own module in app/code/local and add the library in the module folder if that library is already Magento code
  • or if it's pure PHP and not Magento code still create your own module in app/code/local and add the library under the lib folder

In both case you will have to use include / require statements to be able to use your library or customize the autoloader of Magento so you can use those classes directly.

Also as a gift here is a Ben Marks meme to remember :

enter image description here

Licencié sous: CC-BY-SA avec attribution
Non affilié à magento.stackexchange
scroll top