dculley Posted November 3, 2012 Posted November 3, 2012 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
tgely Posted November 4, 2012 Posted November 4, 2012 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'); 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.
dculley Posted November 4, 2012 Author Posted November 4, 2012 Thank you. I had done tried / done the changes to login.php. But did not figure out the other. Thanks again.
dculley Posted November 4, 2012 Author Posted November 4, 2012 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.
dculley Posted November 4, 2012 Author Posted November 4, 2012 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.
tgely Posted November 7, 2012 Posted November 7, 2012 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 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.
dculley Posted November 10, 2012 Author Posted November 10, 2012 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.
pattila86 Posted October 16, 2013 Posted October 16, 2013 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'];
Recommended Posts
Archived
This topic is now archived and is closed to further replies.