Community Add-Ons
| Maintainers: | phi148 |
Capitalize First Letter for Create Account Fields
for osCommerce Online Merchant v2.2
This may be the simplest contribution ever. Many of our customers were to lazy to capitalize the first letter of the following fields :
First Name
Last Name
City
Business Name
Street Address
This drove me crazy, so, I fixed this for them on the fly using the ucwords() function.
-------------------
Example from create_account.php
To capitalize the first letter of the "first name" field:
FIND :
$firstname = tep_db_prepare_input($HTTP_POST_VARS['firstname']);
CHANGE TO :
$firstname = tep_db_prepare_input($HTTP_POST_VARS['firstname']);
$firstname = ucwords($firstname);
------------
Done! Simply do that for any field you wish to capitalize for your customers.
Legend:
Download
Report
So simple yet so complicated!
Converting last names is not such an easy task, what about all those MacDonalds that become Macdonalds or the Hyphen-Hyphens that become the Hyphen-hyphens or the van der Capitals that become the Van Der Capitals...
Have a look at this on php.net:
http://www.php.net/manual/en/function.ucwords.php
then scroll down a bit. The contributions from the Italians are pretty comprehensive but still in the end none of them work 100%...
Mind you all is well if you are a MacDonald but there again what about the Macallisters who then become the MacAllisters!
