views:

273

answers:

3

I found a guide on how to add new attributes to users, it explains that for this operation I must modify some files in the app / code / core / Mage directory (the directory that contains Magento’s modules).

But if i make some changes in that folder will this affect future upgrades?

Will an upgrade will delete my changes?

Should I limit the changes only to my modules to not have problems with updates?

+1  A: 

Yes, changes such as these will be overwritten.

If you have such changes, try to:

  • keep core changes to a minimum
  • document any changes you make
  • report the issues on the Magrnto web site so that the changes can be replicated for everyone else
Jon Winstanley
Thanks you have been very helpful
mck89
+5  A: 

You can also make a copy of the file in app/code/local/ with the same directory structure as the file has under app/code/core/. File under local will override those under core and will not be affected by upgrades.

For example:

app/code/local/Mage/Checkout/Block/Onepage/Billing.php

will override:

app/code/core/Mage/Checkout/Block/Onepage/Billing.php

and will not be overwritten by upgrades. Note that this will only work for Block and Model files.

You can also override files through custom modules with the config.xml file, although this is a bit more advanced.

Chris Norton
True, overriding is a good thought. I suppose it depends on the size and complexity of the changes
Jon Winstanley
Thanks you give me hope:)
mck89
it will work for Helpers too, just not controllers. The benefit of doing it 'properly' with a config-rewrite, is that you can extend the built-in class and replace/extend only the bit you need to tweak, but both methods will need reviewing/testing when you come to upgrade, just in case the way something works has changed
Greg
A: 

Controllers would work as well if you enable that Module in local space

http://stackoverflow.com/questions/2916609/local-vs-core-contoller

latvian