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 do I.. prevent having Magento upgrades overwritting custom code? 
 
Rvo
Jr. Member
 
Total Posts:  6
Joined:  2008-08-05
 

Hello,

I have searched the forums and google, but couldn’t come to a straight answer. The problem is as follows: on the homepage I have a block with “New” products. Now, I want to display a CUSTOM attribute ‘author’ (it’s a book store) which I get in the template-file (new.phtml) via the following code:

$_product->getResource()->getAttribute('author')->getFrontend()->getValue($_product);

Also I want to display the STANDARD attribute “short_description”. Now, the fact of the matter is that using the following code..

echo $_product->getShortDescription();

.. does not do anything. Actually, both attributes won’t do anything for me, unless I specifically go to the New.php in /app/code/core/Mage/Catalog/Block/Product.New.php and add ‘short_description’ as well as ‘author’ to the list of attributes in:

->addAttributeToSelect(array('name''price''small_image''short_description''author'), 'inner')

I find it weird that ‘short_description’ isn’t default selected, but okay. The ‘author’ is custom, so I understand that, but now for my question:
Each time I upgrade Magento I seem to lose most of the custom stuff like I just described. As I am solely managing 4 magento-stores (each a different type of store) this can get a bit frustrating, having to implement my custom things every upgrade. Not to mention it costs me as lot of time looking up my customization notes and finding the stuff I need to replace.

How is this handled best? Is it something I have to live with or can I build something custom that does the same but isn’t part of the Core so that I can keep it running every upgrade?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Rvo
Jr. Member
 
Total Posts:  6
Joined:  2008-08-05
 

Anyone any idea?

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