I'm trying to modify my registration form on Magento removing the firstname, lastname and the password confirmation.
At the moment I've changed the "is_required" in the "eav_attribute" table for FirstName and LastName (not sure if there is something also for the password confirmation).
I've updated the code here
public_html/ec/app/design/frontend/typologancee/default/template/customer/form register.phtml
in order to remove the 3 fields from the UI
I've removed the code
['validate-cpassword', 'Please make sure your passwords match.', function(v) {
var conf = $('confirmation') ? $('confirmation') : $$('.validate-cpassword')[0];
var pass = false;
if ($('password')) {
pass = $('password');
}
var passwordElements = $$('.validate-password');
for (var i = 0; i < passwordElements.size(); i++) {
var passwordElement = passwordElements[i];
if (passwordElement.up('form').id == conf.up('form').id) {
pass = passwordElement;
}
}
if ($$('.validate-admin-password').size()) {
pass = $$('.validate-admin-password')[0];
}
return (pass.value == conf.value);
}],
from
/public_html/ec/js/prototype/validation.js
I removed
if (!Zend_Validate::is( trim($this->getFirstname()) , 'NotEmpty')) { $errors[] = Mage::helper('customer')->__('The first name cannot be empty.'); }
if (!Zend_Validate::is( trim($this->getLastname()) , 'NotEmpty')) { $errors[] = Mage::helper('customer')->__('The last name cannot be empty.'); }
in
/public_html/ec/app/code/core/Mage/Customer/Model/Customer.php
Now I'm still getting an error during the registration:
Please make sure your passwords match.
Also changing
$confirmation = $this->getPasswordConfirmation(); if ($password != $confirmation) { $errors[] = Mage::helper('customer')->__('Please make sure your passwords match.'); }
with
$confirmation = $this->getConfirmation(); if ($password != $confirmation) { $errors[] = Mage::helper('customer')->__('Please make sure your passwords match.'); }
nothing happen. Do you have idea on how to solve this?
Thanks!!