Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

How to alter app->code without losing changes
 
Deelicious
Jr. Member
 
Total Posts:  17
Joined:  2007-10-26
 

Am I correct in understanding that if I alter files in app->code->core->Mage and then upgrade my version in the future, the changes will be overwritten by the new version? If so, is there a way to duplicate the folder structure like themes to preserve the changes or is this not possible?

Thanks for any help.

 
Magento Community Magento Community
Magento Community
Magento Community
 
vianetz
Guru
 
Avatar
Total Posts:  537
Joined:  2008-04-13
Munich, Germany
 

Yes, you’re right.
You can create a new module that will be upgradeable.

 
Magento Community Magento Community
Magento Community
Magento Community
 
greggsand
Jr. Member
 
Avatar
Total Posts:  29
Joined:  2008-04-19
 

I would like to know this too.

I have just kept a log of the files that I’ve changed. But there has to be an easier/better way I would imagine…

 
Magento Community Magento Community
Magento Community
Magento Community
 
bcelenza
Member
 
Avatar
Total Posts:  44
Joined:  2008-08-27
 

You are correct in your understanding that anything in the Core code will be overwritten during an upgrade. In fact, it’s safe to assume that anything that comes with the default Magento download has the right to be overwritten. This includes templates.

The safest way to alter Magento is the following:
1) Altering code: Create a module that extends the current Core functionality. This will keep it separate from the core code and make it persistent during the upgrade. The only issue you may run into is, if extending core code, you may need to make some adjustments to your code after the upgrade. I haven’t had to do this yet though.

2) Altering the templates: Copy the template you’d like to modify and paste it under a new name (all folders and files under app/design). Then modify your copy. Varien updates their default template a lot, so your changes will always be overwritten. Best to create a new template with your changes.

Does this answer your question?

 
Magento Community Magento Community
Magento Community
Magento Community
 
inthewoods
Sr. Member
 
Avatar
Total Posts:  103
Joined:  2008-07-11
Carson, Wa.
 

have a look at this: http://www.magentocommerce.com/wiki/groups/174/changing_and_customizing_magento_code

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top