Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Add "Welcome (fist name) (last name) to Login


dculley

Recommended Posts

Posted

Just wondering does anyone know or have a script to add a greeting after the customer logs in to say Welcome with the customers name.

 

 

I have attached a pic in case the pic I copied to this form dos not show.

 

Thanks

WPIC.ZIP

Posted

You can use this code:

<?php echo tep_customer_greeting_full_name(); ?>

 

insert a new function:

catalog/includes/general.php

////
// Return a customer greeting
function tep_customer_greeting_full_name() {
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 . ' ' . $customer_last_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;
}

 

 

And need some change in login.php

 

Find:

// Check if email exists
$check_customer_query = tep_db_query("select customers_id, customers_firstname, customers_password, customers_email_address, customers_default_address_id from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'");

 

change:

// Check if email exists
$check_customer_query = tep_db_query("select customers_id, customers_firstname, customers_lastname, customers_password, customers_email_address, customers_default_address_id from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'");

 

find:

 tep_session_register('customer_first_name');

 

change to:

 tep_session_register('customer_first_name');
 tep_session_register('customer_last_name');

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Posted

Thank you. I had done tried / done the changes to login.php. But did not figure out the other. Thanks again.

Posted

I didn't have a general.php to edit. running 2.3.3. So I created one.

 

Where does the <?php echo tep_customer_greeting_full_name(); ?> go. under what file am I looking for. I tried template_main.php.

Posted

Corrected the above general.php. Deleted the one I created under includes and changed the lines under includes/functions/general.php.

 

Still not sure where the echo goes.

Posted

I didn't have a general.php to edit. running 2.3.3. So I created one.

 

Where does the <?php echo tep_customer_greeting_full_name(); ?> go. under what file am I looking for. I tried template_main.php.

 

Sorry you have one in catalog/includes/functions/general.php

 

The echo code could be in catalog/includes/header.php or catalog/includes/footer.php

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Posted

Your lead help me.. Thanks. I'm using a template from AlgoZone. So Instead of updating header.php, I found that I had to update 2 of their files. Template_main.php and template_styles.css. Thanks again. You pointed me in the right direction.

  • 11 months later...
Posted

I think need also one change in login.php

 

Find:

$customer_first_name = $check_customer['customers_firstname'];

 

change:

 

$customer_first_name = $check_customer['customers_firstname'];

$customer_last_name = $check_customer['customers_lastname'];

Archived

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

×
×
  • Create New...