Guest Posted January 21, 2005 Posted January 21, 2005 Howdy all, I was recently testing my site and ran across a rather weird problem. I have the customer_discount contrib installed and the addon to it that will notify the customer upon logging in that the are a repeat customer and receive this % discount. Everything works great EXCEPT if you create a new account..after the completion of the account creation when you get returned back to the main page and it should say: Welcome Back! (name), etc.... mine doesn't it still reads the reg text Welcome Guest, etc... however the nav bar at the top changes from my account to logoff so it seems that you are logged in, but your are not (really weird). After combing thru everything I think I have it down to this bit of code that is causing the problem, however I have no idea on how to fix it. Could someone please look at it and help me fix it. // Return a customer greeting ?function tep_customer_greeting() { ? ?global $customer_id, $customer_comm_greet, $customer_first_name, $customer_discount; ?if (tep_session_is_registered('customer_first_name') && tep_session_is_registered('customer_id') && tep_session_is_registered('customer_discount')) { ?if ($customer_discount > 0) { ?$greeting_string = sprintf(TEXT_GREETING_PERSONAL_DISCOUNT_RATE, tep_output_string_protected($customer_first_name), tep_output_string($customer_comm_greet), tep_output_string($customer_discount), tep_href_link(FILENAME_PRODUCTS_NEW)); ? ?} else { ? ? ?$greeting_string = sprintf(TEXT_GREETING_PERSONAL, tep_output_string_protected($customer_first_name), tep_output_string($customer_comm_greet), 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; ?} I think it has to do with the bottom two bits of code..some how it is skipping the else statement for the personal greeting and only doing the guest greeting after creating an account. Please any help on this would be great!!! RW
boxtel Posted January 21, 2005 Posted January 21, 2005 Howdy all,I was recently testing my site and ran across a rather weird problem. I have the customer_discount contrib installed and the addon to it that will notify the customer upon logging in that the are a repeat customer and receive this % discount. Everything works great EXCEPT if you create a new account..after the completion of the account creation when you get returned back to the main page and it should say: Welcome Back! (name), etc.... mine doesn't it still reads the reg text Welcome Guest, etc... however the nav bar at the top changes from my account to logoff so it seems that you are logged in, but your are not (really weird). After combing thru everything I think I have it down to this bit of code that is causing the problem, however I have no idea on how to fix it. Could someone please look at it and help me fix it. // Return a customer greeting function tep_customer_greeting() { global $customer_id, $customer_comm_greet, $customer_first_name, $customer_discount; if (tep_session_is_registered('customer_first_name') && tep_session_is_registered('customer_id') && tep_session_is_registered('customer_discount')) { if ($customer_discount > 0) { $greeting_string = sprintf(TEXT_GREETING_PERSONAL_DISCOUNT_RATE, tep_output_string_protected($customer_first_name), tep_output_string($customer_comm_greet), tep_output_string($customer_discount), tep_href_link(FILENAME_PRODUCTS_NEW)); } else { $greeting_string = sprintf(TEXT_GREETING_PERSONAL, tep_output_string_protected($customer_first_name), tep_output_string($customer_comm_greet), 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; } I think it has to do with the bottom two bits of code..some how it is skipping the else statement for the personal greeting and only doing the guest greeting after creating an account. Please any help on this would be great!!! RW <{POST_SNAPBACK}> I guess it has to do with the fact that your customer_discount session variable is not registered. Treasurer MFC
Guest Posted January 21, 2005 Posted January 21, 2005 Any ideas on how to go about registaring it? I do have this line added to login.php tep_session_register('customer_discount'); so it is in there during login, but maybe I also need it somewhere else? RW I guess it has to do with the fact that your customer_discount session variable is not registered. <{POST_SNAPBACK}>
Jan Zonjee Posted January 21, 2005 Posted January 21, 2005 Is there also a line in logoff.php to unregister that particular session data? tep_session_unregister('customer_discount');
Recommended Posts
Archived
This topic is now archived and is closed to further replies.