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?
Wi开发者_如何学Cll an upgrade will delete my changes?
Should I limit the changes only to my modules to not have problems with updates?
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.
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
Controllers would work as well if you enable that Module in local space
local vs core controller
精彩评论