I am try to override Function public function validate() in app/code/core/Mage/Customer/Model/Customer.php
To Restrict user registration by email domain i can do this by change directly in Function public function validate() in app/code/core/Mage/Customer/Model/Customer.php but I need to override it in codepool.
With Creating module in codepool :
/app/code/local/Codefire/Customer/etc/config.xml
<?xml version="1.0"?> <config> <modules> <Codefire_Customer> <version>0.1</version> </Codefire_Customer> </modules> <global> <models> <customer> <rewrite> <customer>Codefire_Customer_Model_Customer</customer> </rewrite> </customer> </models> </global> </config> /app/etc/modules/Codefire_Customer.xml
<?xml version="1.0"?> <config> <modules> <Codefire_Customer> <active>true</active> <codepool>local</codepool> </Codefire_Customer> </modules> </config> /app/code/local/Codefire/Customer/Model/Customer.php
<?php /** * Overrite Customer model */ class Codefire_Customer_Model_Customer extends Mage_Customer_Model_Customer{ /** * Validate customer attribute values. * * @return bool */ public function validate() { echo 'I am here'; die; } I need call this function when do new registration.