1

If I copy a core file to fix a bug, do I need to copy the whole file or is enough to copy only the function?

Like I copy /app/code/core/Mage/Core/Model/Store.php to /app/code/local/Mage/Core/Model/Store.php to fix a bug in public function roundPrice($price):

class Mage_Core_Model_Store extends Mage_Core_Model_Abstract
{
    public function roundPrice($price)
    {
        // fix
    }
}

1 Answer 1

4

If you take the 'file clone' approach you need to copy the entire file. But in the case you described there is no need to copy the file. You can rewrite the class in one of your modules and int that case you will only need to copy & modify one method.
See how you can rewrite a class.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.