Forums / General Questions / Dear Mr 'Name'... How to change

Dear Mr 'Name'... How to change

Locked

Views: 1,975

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
5 Sep 2007, 12:20 PM
#1
warstormer avatar

warstormer

Zen Follower

Join Date:
Aug 2007
Posts:
120
Plugin Contributions:
0

Dear Mr 'Name'... How to change

Hi, I'm currently getting create account confirmation emails with Dear Mr /Ms. 'Name'. The code in create_account.php is:

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

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

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

What should be replaced/added where %s is?

Thanks....

5 Sep 2007, 12:43 PM
#2
chuckl avatar

chuckl

Totally Zenned

Join Date:
Nov 2006
Location:
Papworth, Cambridgeshire, UK
Posts:
717
Plugin Contributions:
0

Re: Dear Mr 'Name'... How to change

That would be true of /includes/languages/english/create_account.php, which is where the text used on any page e.g. the Create Account page is defined.

That text is used in the matching filename in the /includes/modules folder, i.e. /includes/modules/create_account.php which does the actual grunt work of producing the page or anything else required. e.g. an email to the customer and admin.

In there, you will find

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, $firstname);

which translates to 'replace %s with firstname or lastname as entered, as appropriate'

5 Sep 2007, 12:54 PM
#3
warstormer avatar

warstormer

Zen Follower

Join Date:
Aug 2007
Posts:
120
Plugin Contributions:
0

Re: Dear Mr 'Name'... How to change

Chuckl:

That would be true of /includes/languages/english/create_account.php, which is where the text used on any page e.g. the Create Account page is defined.

That text is used in the matching filename in the /includes/modules folder, i.e. /includes/modules/create_account.php which does the actual grunt work of producing the page or anything else required. e.g. an email to the customer and admin.

In there, you will find

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, $firstname);

which translates to 'replace %s with firstname or lastname as entered, as appropriate'

Ah, I should probably explain that I'm trying to tidy up an old version of zen (1.26) so there isn't an includes/modules/create_account.php file.... I know it should be upgraded but not up to me at the mo... :(

5 Sep 2007, 12:56 PM
#4
warstormer avatar

warstormer

Zen Follower

Join Date:
Aug 2007
Posts:
120
Plugin Contributions:
0

Re: Dear Mr 'Name'... How to change

I did find some of the code you displayed in includes/modules/pages/create_account/header_php.php as in:

Line #724 : $email_text = sprintf(EMAIL_GREET_MR, $lastname);

5 Sep 2007, 1:37 PM
#5
chuckl avatar

chuckl

Totally Zenned

Join Date:
Nov 2006
Location:
Papworth, Cambridgeshire, UK
Posts:
717
Plugin Contributions:
0

Re: Dear Mr 'Name'... How to change

Indeed , I was about to tell you to look in /includes/modules/pages/create_account/header_php.php.
That is where it lived prior to version 1.3

5 Sep 2007, 1:49 PM
#6
warstormer avatar

warstormer

Zen Follower

Join Date:
Aug 2007
Posts:
120
Plugin Contributions:
0

Re: Dear Mr 'Name'... How to change

But if that text is already there in includes/modules/pages/create account/header_php.php why does the email keep saying Dear Mr 'Name'?

5 Sep 2007, 2:05 PM
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Dear Mr 'Name'... How to change

The salutation is determined based on the gender of the customer, which they selected when they created their account.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

5 Sep 2007, 2:19 PM
#8
warstormer avatar

warstormer

Zen Follower

Join Date:
Aug 2007
Posts:
120
Plugin Contributions:
0

Re: Dear Mr 'Name'... How to change

Sorry, my bad for probably not explaining properly..... it's the actual 'Name' that's the problem, in that it is actually writing 'Name' instead of the actual customer's surname....

5 Sep 2007, 2:36 PM
#9
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Dear Mr 'Name'... How to change

warstormer:

Sorry, my bad for probably not explaining properly..... it's the actual 'Name' that's the problem, in that it is actually writing 'Name' instead of the actual customer's surname....

If you're using default Zen Cart code, then it should only ever display the actual surname from the logged-in-customer's information in the database and viewable from their My Account area.

If you've installed some sort of custom code to expand on the email/newsletter features, I suppose there could be an error in the custom coding to cause something else to show up.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

5 Sep 2007, 3:25 PM
#10
warstormer avatar

warstormer

Zen Follower

Join Date:
Aug 2007
Posts:
120
Plugin Contributions:
0

Re: Dear Mr 'Name'... How to change

DrByte:

If you're using default Zen Cart code, then it should only ever display the actual surname from the logged-in-customer's information in the database and viewable from their My Account area.

If you've installed some sort of custom code to expand on the email/newsletter features, I suppose there could be an error in the custom coding to cause something else to show up.

I'm coming into this after the fact, but have been told that the template is probably by Template Monster. I've already practically given up trying to solve another problem (http://www.zen-cart.com/forum/showthread.php?t=74516) ... In this case files seem to be where they're supposed to be but frankly it's a mess...