Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Welcome Back


Guest

Recommended Posts

Hi all,

In languages/english.php is a line referring to the "Welcome Back" page:

 

define('TEXT_GREETING_PERSONAL', 'Welcome back <span class="greetUser">%s!</span> Would you like to see which <a href="%s"><u>new products</u></a> are available to purchase?');

 

What is %s, and how do I change the "Welcome Back" page from using only the First Name into using e.g. Title, First Name, Last Name. Title is incorporated in my DB system and works in sending confirmation email.

 

Any help, direction much appreciated. have been working on this for the last 48 hours and can not find the solution.

Link to comment
Share on other sites

In your includes/functions/general.php

 

Find the following function:

 

function tep_customer_greeting() {
   global $customer_id, $customer_first_name;

   if (tep_session_is_registered('customer_first_name') && tep_session_is_registered('customer_id')) {
     $greeting_string = sprintf(TEXT_GREETING_PERSONAL, tep_output_string_protected($customer_first_name), tep_href_link(FILENAME_PRODUCTS_NEW));
   } else {
     $greeting_string = sprintf(TEXT_GREETING_GUEST, tep_href_link(FILENAME_LOGIN, '', 'SSL'), tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));
   }

   return $greeting_string;
 }

Replace with:

 

  function tep_customer_greeting() {
   global $customer_id, $customer_first_name;


$customer_query = tep_db_query("select customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " where customers_id = " . $customer_id );

     $customer = tep_db_fetch_array($customer_query);


   if (tep_session_is_registered('customer_first_name') && tep_session_is_registered('customer_id')) {
     $greeting_string = sprintf(TEXT_GREETING_PERSONAL, tep_output_string_protected($customer[customers_firstname].' '.$customer[customers_lastname]), tep_href_link(FILENAME_PRODUCTS_NEW));
   } else {
     $greeting_string = sprintf(TEXT_GREETING_GUEST, tep_href_link(FILENAME_LOGIN, '', 'SSL'), tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));
   }

   return $greeting_string;
 }

 

Nacer.

Link to comment
Share on other sites

In your includes/functions/general.php

 

Find the following function:

 

function tep_customer_greeting() {
? ?global $customer_id, $customer_first_name;

? ?if (tep_session_is_registered('customer_first_name') && tep_session_is_registered('customer_id')) {
? ? ?$greeting_string = sprintf(TEXT_GREETING_PERSONAL, tep_output_string_protected($customer_first_name), tep_href_link(FILENAME_PRODUCTS_NEW));
? ?} else {
? ? ?$greeting_string = sprintf(TEXT_GREETING_GUEST, tep_href_link(FILENAME_LOGIN, '', 'SSL'), tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));
? ?}

? ?return $greeting_string;
?}

Replace with:

 

 ?function tep_customer_greeting() {
? ?global $customer_id, $customer_first_name;
$customer_query = tep_db_query("select customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " where customers_id = " . $customer_id );

? ? ?$customer = tep_db_fetch_array($customer_query);
? ?if (tep_session_is_registered('customer_first_name') && tep_session_is_registered('customer_id')) {
? ? ?$greeting_string = sprintf(TEXT_GREETING_PERSONAL, tep_output_string_protected($customer[customers_firstname].' '.$customer[customers_lastname]), tep_href_link(FILENAME_PRODUCTS_NEW));
? ?} else {
? ? ?$greeting_string = sprintf(TEXT_GREETING_GUEST, tep_href_link(FILENAME_LOGIN, '', 'SSL'), tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));
? ?}

? ?return $greeting_string;
?}

 

Nacer.

 

Thanks Nacer,

In other words if I would also need the customer title I could easily say:

 

$customer_query = tep_db_query("select customers_title, select customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " where customers_id = " . $customer_id );

 

AND

 

$greeting_string = sprintf(TEXT_GREETING_PERSONAL, tep_output_string_protected($customer[customers_title].' '.$customer[customers_firstname].' '.$customer[customers_lastname])......etc.

 

Will try this too, as I have a mere complex solution seen on the forum which I just implemented that worked but NOT the title greeting that comes out as e.g. Welcome Back "2" Any Name where 2 stand for Mrs.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...