Wednesday, 19 June 2013

How to remove last name validation when create account in magento


1.Remove last name from:  app\design\frontend\default\default\template\persistent\checkout\onepage

\billing.phtml

2.now Comment validation from /mage/customer/model/customer.php
find function function validate() and comment below code
if (!Zend_Validate::is($this->getTelephone(), \\\’NotEmpty\\\’)) {
          $errors[] = Mage::helper(\\\’customer\\\’)->__(\\\’Please enter the telephone number.\\\’);
       }

same as above in file /mage/customer/model/Address/abstract.php file

3.now for Display only frst name in grid we have to modify mage/adminhtml/Block/customer/grid.php file find
$this->addColumn('name', array(
            'header'    => Mage::helper('customer')->__('Name'),
            'index'     => 'name'
        ));
 & replace it with below code
$this->addColumn('name', array(
            'header'    => Mage::helper('customer')->__('Name'),
            'index'     => 'firstname'
        ));

1 comment:

  1. Hi Krupa,

    great post. Please do you know how to do the same in billing and shipping (checkout section)? I'm using version 1.9

    Thank you

    ReplyDelete