Proper way of including Magento core class
Whenever, I have to rewrite the Magento core class, I use following require definition in order to include that class to avoid file not found error later when I enable Magento compiler later in production.
<?php
if ( defined('COMPILER_INCLUDE_PATH') )
require 'Mage_Customer_Model_Customer.php';
else
require 'Mage/Customer/Model/Customer.php';
class Mycompany_Mymodule_Model_Customer
extends Mage_Customer_Model_Customer
{
...
}
http://oceansgem.com/2012/12/proper-way-of-including-core-magento-class/
Written by Bhupesh Pranami
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Magento
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#