1

i want to make last name optional , can i do it via any setting in admin ?? or what will be best way to do it.. how can i do it via code , i tried setting customer attributes but no sucess

2

I think you have to do two things, first, update the attribute last name:

Implement your own setup, depending on Mage_Catalog_Model_Resource_Setup:

$this->updateAttribute('customer', 'last_name', 'is_required', 0);

"Beware of bugs in the above code, I only proved it correct, not tried it" - Donald Knuth

And second you need to change the registration template app/design/frontend/base/default/template/customer/widget/name.phtml, and remove the <em>*</em> for lastname. Magento will take care of the correct class for JS validation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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