Convert letters


59

If a new customer writes the letters in lower case instead of uppercase when registering, this entry in the database can be automatically corrected. Example: john doe becomes John Doe

Find in: catalog/create_account.php

    $firstname = tep_db_prepare_input($_POST['firstname']);
    $lastname = tep_db_prepare_input($_POST['lastname']);
    if (ACCOUNT_DOB == 'true') $dob = tep_db_prepare_input($_POST['dob']);
    $email_address = tep_db_prepare_input($_POST['email_address']);
    if (ACCOUNT_COMPANY == 'true') $company = tep_db_prepare_input($_POST['company']);
    $street_address = tep_db_prepare_input($_POST['street_address']);
    if (ACCOUNT_SUBURB == 'true') $suburb = tep_db_prepare_input($_POST['suburb']);
    $postcode = tep_db_prepare_input($_POST['postcode']);
    $city = tep_db_prepare_input($_POST['city']);
    if (ACCOUNT_STATE == 'true') {
      $state = tep_db_prepare_input($_POST['state']);
      if (isset($_POST['zone_id'])) {
        $zone_id = tep_db_prepare_input($_POST['zone_id']);
      } else {
        $zone_id = false;
      }
    }

Change to:

    $firstname = tep_db_prepare_input(ucwords($_POST['firstname']));
    $lastname = tep_db_prepare_input(ucwords($_POST['lastname']));
    if (ACCOUNT_DOB == 'true') $dob = tep_db_prepare_input($_POST['dob']);
    $email_address = tep_db_prepare_input($_POST['email_address']);
    if (ACCOUNT_COMPANY == 'true') $company = tep_db_prepare_input(ucwords($_POST['company']));
    $street_address = tep_db_prepare_input(ucwords($_POST['street_address']));
    if (ACCOUNT_SUBURB == 'true') $suburb = tep_db_prepare_input(ucwords($_POST['suburb']));
    $postcode = tep_db_prepare_input($_POST['postcode']);
    $city = tep_db_prepare_input(ucwords($_POST['city']));
    if (ACCOUNT_STATE == 'true') {
      $state = tep_db_prepare_input(ucwords($_POST['state']));
      if (isset($_POST['zone_id'])) {
        $zone_id = tep_db_prepare_input($_POST['zone_id']);
      } else {
        $zone_id = false;
      }
    }

w3c-Commerce
w3c-Commerce Downloads
  w3c-Commerce Add-ons php8