1. Remove the classes for JS validation from your templates.
customer/widget/name.phtml
Remove class="required"
from the label relating to the lastname
field at line 80
Remove <?php echo $this->helper('customer/address')
->getAttributeValidationClass('lastname') ?>
from the input relating to lastname
at line 82
2. Copy your core files from:
/app/code/core/Mage/customer/Model/Address/Abstract.php
/app/code/core/Mage/customer/Model/Customer.php
into:
/app/code/local/Mage/customer/Model/Address/Abstract.php
/app/code/local/Mage/customer/Model/Customer.php
And comment out everything related to Zend validation of Lastname.
/app/code/local/Mage/customer/Model/Address/Abstract.php:
/*
if (!Zend_Validate::is($this->getLastname(), 'NotEmpty')) {
$this->addError(Mage::helper('customer')->__('Please enter the last name.'));
}
*/
/app/code/local/Mage/customer/Model/Customer.php
php code
/*
if (!Zend_Validate::is( trim($this->getLastname()) , 'NotEmpty')) {
$errors[] = Mage::helper('customer')->__('The last name cannot be empty.');
}
*/
3. Update the config.xml file for customer
/app/code/core/Mage/customer/etc/config.xml
copy to file
/app/code/local/Mage/customer/etc/config.xml
For last_name
field,
set required value "1" to "0"
4. At last update using row query in database
UPDATE eav_attribute SET is_required = 0 WHERE attribute_code = 'lastname'
'required-entry'
on input field? By this class javascript knows which field to validate.'require-entry'
which belongs to last name input field. After please test for all your other cases. Maybe this will help you too.