i have the file app\code\core\Mage\Adminhtml\controllers\Catalog\ProductController.php. how can I add my code in this file without modify the source.
Example: - this file contain fuction saveAction
public function saveAction() { $storeId = $this->getRequest()->getParam('store'); $redirectBack = $this->getRequest()->getParam('back', false); ............................. include 'my_code.php'; // here I type / include my code // it's not recomanded .... because when I want to update the magento I lose my code // know somebody a diferent solution to add my code? ............................. else { $this->_redirect('*/*/', array('store'=>$storeId)); }
I just keep a real tight and up to date log of all the changes i make to core files, i try and avoid it but sometimes it inevitable. That way on the next update i can replace the files and watch my magento installation fall apart!!! but at least it falls apart in a structured and well documented approch!!