Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Login Box w/My Account v5.0


Ajeh

Recommended Posts

That I am not sure of either.

 

I looked at the code for the loginbox.php just in case there is something odd about it, but I am not seeing anything that would effect whether or not the name shows.

 

Everything is based on tep_session_is_registered('customer_id') and nothing is being set because of this, it is just used in the IF statements along with a test on the filenames to know what to show/not show.

 

Let me know if you come up with something if I get time, I will see if I can load a clean April snapshot and see if it gets moofy for me.

Link to comment
Share on other sites

That I am not sure of either.

 

Let me know if you come up with something if I get time, I will see if I can load a clean April snapshot and see if it gets moofy for me.

 

"MOOFY"?!?!

 

Hmmm...I've been looking Linda, and I can't find this in the PHP docs...is this a technical term? :lol: :lol: :lol:

 

Aodhan

Link to comment
Share on other sites

Well I am stumped with this!

I have been comparing what the problem might be, but to no evail.

 

I even put back my old version of login box, and I found this...

 

The old version of login box did not show the user name in the welcome message after login either, but!! Only if you used the loginbox.

If you still went to login.php page, it would then show the name on the main page.

 

However since adding this version (5.2) of LoginBox it no longer shows the name in Welcome message which ever way I do it.

So something along the way is effecting the code, but I can not see what it is.

 

If anyone has any ideas, please let me know.

As mentioned before, I am using an April dated Snapshot.

Let me know if you have similar problems...

 

ta

 

CC.

Link to comment
Share on other sites

Nope, I have only messed with general.php to add some functions on the same day, but this was not related.

They were for manufacturer tables, so I cant see how that would have effected it.

 

And I havent touched the TEXT files at all on this one.

 

What are you thinking might be the cause Linda?

I'll have a butchers and see what I can find, if it is inline with your thinking.

 

CC.

Link to comment
Share on other sites

Check the function tep_customer_greeting in general.php

 

It has been changed over the months and perhaps one of the changes is effecting your greeting.

 

It should say Hi Linda when I am logged in and Hi Guest when I am logged out.

 

But ... back in the ol'den days ... it still said Hi Linda after I logged out. This has changed since then depending on what date that function is that you are using.

Link to comment
Share on other sites

I changed that a while back anyway.

 

I know it was put in on purpose, but I personally saw this as something customers might think is a bug. So I got rid of that a while ago.

 

Perhaps this is causing me problems...

 

Do you know, if I just update that part to the latest version, just the tep_customer_greeting in general.php, will it go straight in, or is it likely to cause me problems??

 

thanks again Lindy. :wink:

 

CC.

Link to comment
Share on other sites

This is the current function:

////

// Return a customer greeting

 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, $customer_first_name, tep_href_link(FILENAME_PRODUCTS_NEW, '', 'NONSSL'));

   } else {

     $greeting_string = sprintf(TEXT_GREETING_GUEST, tep_href_link(FILENAME_LOGIN, '', 'SSL'), tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));

   }



   return $greeting_string;

 }

 

This is from July 9th:

////

// Return a customer greeting

 function tep_customer_greeting() {

   global $HTTP_COOKIE_VARS, $customer_id, $customer_first_name;



   if ($HTTP_COOKIE_VARS['first_name']) {

     $first_name = stripslashes($HTTP_COOKIE_VARS['first_name']);

   } elseif ($customer_first_name) {

     $first_name = $customer_first_name;

   }



   if ($first_name) {

     $greeting_string = sprintf(TEXT_GREETING_PERSONAL, $first_name, tep_href_link(FILENAME_PRODUCTS_NEW, '', 'NONSSL'));

     if (!$customer_id) {

       $greeting_string .= '<br>' . sprintf(TEXT_GREETING_PERSONAL_RELOGON, $first_name, tep_href_link(FILENAME_LOGIN, '', 'SSL'));

     }

   } else {

     $greeting_string = sprintf(TEXT_GREETING_GUEST, tep_href_link(FILENAME_LOGIN, '', 'SSL'), tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));

   }



   return $greeting_string;

 }

 

How does your's compare?

Link to comment
Share on other sites

Ok, never mind the last question.

 

I did it anyway, and guess what?

 

Problem solved.

 

The latest function in general.php obviously does a better job thn my old one.

 

Sorted!

Thanks mate.

 

CC.

Link to comment
Share on other sites

Ooooh you beat me to it.

 

Here is what I just tested.

My old code commented out, with my new in below it:

 

////

// Return a customer greeting

/*  function tep_customer_greeting() {

   global $HTTP_COOKIE_VARS, $customer_id, $customer_first_name;



   if ($HTTP_COOKIE_VARS['first_name']) {

     $first_name = stripslashes($HTTP_COOKIE_VARS['first_name']);

   } elseif ($customer_first_name) {

     $first_name = $customer_first_name;

   }



   if ($HTTP_COOKIE_VARS['first_name']) {

     $greeting_string = sprintf(TEXT_GREETING_PERSONAL, $first_name, tep_href_link(FILENAME_PRODUCTS_NEW, '', 'NONSSL'));

     if (!$customer_id) {

       $greeting_string .= '<br>' . sprintf(TEXT_GREETING_PERSONAL_RELOGON, $first_name, tep_href_link(FILENAME_LOGIN, '', 'SSL'));

     }

   } else {

     $greeting_string = sprintf(TEXT_GREETING_GUEST, tep_href_link(FILENAME_LOGIN, '', 'SSL'), tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));

   }



   return $greeting_string;

 }*/



////

// Return a customer greeting

 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, $customer_first_name, tep_href_link(FILENAME_PRODUCTS_NEW, '', 'NONSSL'));

   } else {

     $greeting_string = sprintf(TEXT_GREETING_GUEST, tep_href_link(FILENAME_LOGIN, '', 'SSL'), tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));

   }



   return $greeting_string;

 }

 

Works better now.

 

CC.

Link to comment
Share on other sites

Stop typing so fast Linda, you keep beating me to the 'submit' button! :D

 

"... and another bites the dust Yeeeeeeeh!

Dum dum dum, another one biiii....."

 

And so forth... :oops:

Catchy tune.

 

Right I'm off to bed.

Thanks for the help mate.

 

Latrz

CC.

Link to comment
Share on other sites

  • 1 year later...

I know this thread is a little old but reuse and recycle. : )

 

Can someone tell me how to change the way the greetings work? I am mostly confused by all the %s'. I don't know what they are for - <a href=%s> ?????

 

I would like to rework some things and maybe make the link point to their account so they can check on orders they have placed, etc.

 

Any help is appreciated.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...