Customer Name Validation Makes No Sense
Posted: Wed Mar 05, 2008 3:00 pm
This is a heads up on a problem that just occurred for me.
A customer named Li was unable to purchase an item on line because the customer name validation insists on a minimum of 3 characters for first name and last name. This validation should be removed.
The files that need changing to fix this are:
\catalog\controller\account_address.php
\catalog\controller\account_edit.php
\catalog\controller\checkout_address.php
\catalog\controller\account_create.php
in the validate() function in each file, contains code that looks like
which should be, instead
You also have to change the error messages in the language files (english shown as example).
\catalog\language\english\controller\account_address.php
\catalog\language\english\controller\account_edit.php
\catalog\language\english\controller\checkout_address.php
\catalog\language\english\controller\account_create.php
to something like
Note also, the change to 33 here to make the displayed text line up with the test performed in the code.
I actually removed all of the minimums except for password.
A customer named Li was unable to purchase an item on line because the customer name validation insists on a minimum of 3 characters for first name and last name. This validation should be removed.
The files that need changing to fix this are:
\catalog\controller\account_address.php
\catalog\controller\account_edit.php
\catalog\controller\checkout_address.php
\catalog\controller\account_create.php
in the validate() function in each file, contains code that looks like
Code: Select all
if ((strlen($request->get('firstname', 'post')) < 3) || (strlen($request->get('firstname', 'post')) > 32)) {
$this->error['firstname'] = $language->get('error_firstname');
}
if ((strlen($request->get('lastname', 'post')) < 3) || (strlen($request->get('lastname', 'post')) > 32)) {
$this->error['lastname'] = $language->get('error_lastname');
}
Code: Select all
if ((strlen($request->get('firstname', 'post')) > 32)) {
$this->error['firstname'] = $language->get('error_firstname');
}
if ((strlen($request->get('lastname', 'post')) > 32)) {
$this->error['lastname'] = $language->get('error_lastname');
}
\catalog\language\english\controller\account_address.php
\catalog\language\english\controller\account_edit.php
\catalog\language\english\controller\checkout_address.php
\catalog\language\english\controller\account_create.php
to something like
Code: Select all
$_['error_firstname'] = '* First Name must be less than 33 characters!';
$_['error_lastname'] = '* Last Name must be less than 33 characters!';
I actually removed all of the minimums except for password.