Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Customers Title Pulldown


Guest

Recommended Posts

I have been able to install successfully a contribution concerning customers title, such as mr. mrs and miss, with no problems but one, and i can't figure it out.

 

When a new customer signup, they get a confirmation email, however, the title is shown as a "int" i.e. the number for the title (title_id) 1, 2, 3, etc..

 

If it is e.g. Dear Mr Jim Anyname, it will show in the email as Dear 1 Jim Anyname or if it is to be Dear Miss Anny Smith, it is shown as Dear 3 Anny Smith.

 

where in the table 1 = Mr and 2 =Mrs, and 3 = Miss etc....

 

Could you give me some directions here? Have been trying to solve this for the last 24 hours.

 

I checked my 1)general.php file 2)creat_account.php, and it might be that one is mis-configured:

 

// Returns an array with titles

// TABLES: titles

function tep_get_titles($titles_id = '') {

$titles_array = array();

if (tep_not_null($titles_id)) {

$titles = tep_db_query("select titles_name from " . TABLE_TITLES . " where titles_id = '" . (int)$titles_id . "'");

$titles_values = tep_db_fetch_array($titles);

$titles_array = array('titles_name' => $titles_values['titles_name']);

 

} else {

$titles = tep_db_query("select titles_id, titles_name from " . TABLE_TITLES . " order by titles_id");

while ($titles_values = tep_db_fetch_array($titles)) {

$titles_array[] = array('titles_id' => $titles_values['titles_id'],

'titles_name' => $titles_values['titles_name']);

}

}

 

return $titles_array;

}

 

////

// Alias function to tep_get_titles()

function tep_get_title_name($title_id) {

$title_array = tep_get_titles($title_id);

 

return $title_array['titles_name'];

}

 

Or from creat_account.php:

 

define('EMAIL_SUBJECT', 'Welcome to ' . STORE_NAME);

define('EMAIL_GREET_MR', 'Dear Mr %s,' . "\n\n");

define('EMAIL_GREET_MRS', 'Dear Mrs %s,' . "\n\n");

define('EMAIL_GREET_MISS', 'Dear Miss %s,' . "\n\n");

define('EMAIL_GREET_REV', 'Dear Rev %s,' . "\n\n");

define('EMAIL_GREET_FR', 'Dear Fr %s,' . "\n\n");

define('EMAIL_GREET_SR', 'Dear Sr %s,' . "\n\n");

define('EMAIL_GREET_DR', 'Dear Dr %s,' . "\n\n");

define('EMAIL_GREET_NONE', 'Dear %s' . "\n\n");

define('EMAIL_WELCOME', 'Welcome to <b>' . STORE_NAME . '</b>.' . "\n\n");

define('EMAIL_TEXT', 'You can now take part in the <b>various items</b>

 

Can anyone give me some direction where to look for. Thanks.

Link to comment
Share on other sites

post the section of code in create_account.php that is actually performing the Email (and where it is picking the title up from on the form)

 

Do you mean the folowing FalseDawn?

 

// build the message content

$name = $title . ' '. $firstname . ' ' . $lastname;

 

if (ACCOUNT_GENDER == 'true') {

if ($gender == 'm') {

$email_text = sprintf(EMAIL_GREET_MR, $lastname);

} else {

$email_text = sprintf(EMAIL_GREET_MS, $lastname);

}

} else {

$email_text = sprintf(EMAIL_GREET_NONE, $name);

}

 

$email_text .= EMAIL_WELCOME . EMAIL_TEXT . EMAIL_CONTACT . EMAIL_WARNING;

tep_mail($name, $email_address, EMAIL_SUBJECT, $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

 

tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT_SUCCESS, '', 'SSL'));

}

}

 

$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));

?>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...