Zen Cart Logo

Login and Logout

Locked

Views: 1,697

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
20 Sep 2006, 6:46 PM
#1
happyworker avatar

happyworker

New Zenner

Join Date:
Sep 2006
Posts:
40
Plugin Contributions:
0

Login and Logout

Hi there,
Here is a toughy for me, which hopefully someone could shed some light on.

My site is here.

I recently posted a question about getting my Log In greeting into the header and having it work. Here is the post.

Now I have the 'Welcome Guest, would you like to log yourself in?', which is great.

When I click on it and log myself in I get this, 'Hello *****! Would you like to see our newest additions?'.

I would like to change this to 'Hello *****! When your finished you can **log out **here.', or something like that.

Refer to the post to see what code I put in the header.

I'm pretty sure this is what I have to change, located in '/popoutportraits.com/cart/includes/functions/functions_customers.php'

// Return a customer greeting
  function zen_customer_greeting() {

    if (isset($_SESSION['customer_id']) && $_SESSION['customer_first_name']) {
      $greeting_string = sprintf(TEXT_GREETING_PERSONAL, zen_output_string_protected($_SESSION['customer_first_name']), zen_href_link(FILENAME_PRODUCTS_NEW));
    } else {
      $greeting_string = sprintf(TEXT_GREETING_GUEST, zen_href_link(FILENAME_LOGIN, '', 'SSL'), zen_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));
    }

    return $greeting_string;
  }

  function zen_count_customer_orders($id = '', $check_session = true) {
    global $db;

    if (is_numeric($id) == false) {
      if ($_SESSION['customer_id']) {
        $id = $_SESSION['customer_id'];
      } else {
        return 0;
      }
    }

    if ($check_session == true) {
      if ( ($_SESSION['customer_id'] == false) || ($id != $_SESSION['customer_id']) ) {
        return 0;
      }
    }

Any help or suggestions would be appreciated.

Thanks again,
Happyworker

21 Sep 2006, 1:59 PM
#2
happyworker avatar

happyworker

New Zenner

Join Date:
Sep 2006
Posts:
40
Plugin Contributions:
0

Re: Login and Logout

I have now changed my site not to include the above. I found that this would take too much work in changing multiple files in PHP which I'm not all that familiar with.

I have gone back to the login/logoff #navmain, and just moved it over with the css. This is giving me a cleaner code and a cleaner look.

As for the 'Welcome message', well I ended up moving this back and taking out some text.

I just wanted to give an update so that I avoid any question of 'what are you talking about, your site isn't matching what you asked'.

I believe that the intial question is still a good one, and no doubt a hard one. It would be interesting to find out how it works....if someone is keen to work it out.

Cheers,
Happyworker

26 Oct 2006, 7:55 AM
#3
lloyd_borrett avatar

lloyd_borrett

Zen Follower

Join Date:
Mar 2006
Location:
Rosebud, Victoria, Australia
Posts:
308
Plugin Contributions:
2

Re: Login and Logout

G'day Happyworker,

Came across your posts while looking into something similar myself.

The text that is output is TEXT_GREETING_PERSONAL which is defined in /includes/languages/english/your-template/index.php. You would need to change this text.

The zen_customer_greeting function in /includes/functions/functions_customer.php uses that text to output the page content.

You would need to come up with a replacement for the part of that function which provides the link details. That is,

zen_href_link(FILENAME_PRODUCTS_NEW)

Best Regards, Lloyd Borrett.