Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

greetUser with company name of customer


spa2036

Recommended Posts

Posted

I am trying to get the company name with the customer_id and customer_firstname listed as a customer is logged in.

 

What I did so far is:

catalog/login.php change the query to pull the entry_company and add the variables

    $check_country_query = tep_db_query("select entry_country_id, entry_zone_id, entry_company from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$check_customer['customers_id'] . "' and address_book_id = '" . (int)$check_customer['customers_default_address_id'] . "'");

   $customer_company = $check_country['entry_company'];
   tep_session_register('customer_company');

 

Then I changed catalog/includes/functions/general.php

// Return a customer greeting
 function tep_customer_greeting() {
   global $customer_id, $customer_first_name, $customer_company;

   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_output_string_protected($customer_company), tep_output_string_protected($customer_id));
   } else {
     $greeting_string = sprintf(TEXT_GREETING_GUEST, tep_href_link(FILENAME_LOGIN, '', 'SSL'), tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));
   }

   return $greeting_string;
 }

 

And at last placed the placeholders in the define in catalog/includes/languages/yourlanguage.php

define('TEXT_GREETING_PERSONAL', '
Name: %s, company: %s, clientnumber: %s.<br><br>');

 

The name and clientnumber are shown when a customer is logged in, but I am doing something wrong because the company name is not shown.

Where did I go wrong?

Archived

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

×
×
  • Create New...