Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    Dec 2011
    Posts
    18
    Plugin Contributions
    0

    Default Customer Last Name

    HALP!

    I'm stuck in a loop here guys. This seems very rudimentary, and I've found a few threads that seem to answer my exact problem, but the code isn't working when I try to implement it.

    I want a customer greeting to read:

    "Logged in as *First name* *Last name*."

    I have at the moment:

    Logged in as <?php echo zen_output_string_protected($_SESSION['customer_first_name']); ?> <?php echo zen_output_string_protected($_SESSION['customer_last_name']); ?>.

    The first name is working, but the last name isn't.

    I've checked the modules/pages/login/header_php.php, and last name IS being checked into $_SESSION.

    Sorry to ask a dumb question, but I've been failing for hours.

    -Chris

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Customer Last Name

    Where, as in what file, have you added that too?
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Dec 2011
    Posts
    18
    Plugin Contributions
    0

    Default Re: Customer Last Name

    The header for my custom template:

    includes/templates/*my template name*/common/tpl_header.php

    -Chris

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Customer Last Name

    Seems to work fine for me ...

    Can you grab the code around it such as 5 lines above and 5 lines below and post it?
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #5
    Join Date
    Dec 2011
    Posts
    18
    Plugin Contributions
    0

    Default Re: Customer Last Name

    <div id="navMain">
    <ul class="back" style="color:#c50006">
    <?php if ($_SESSION['customer_id']) { ?>
    <li style="float:left; font-size:14px;"">

    Logged in as <a href="<?php echo zen_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>" style="padding:0px;"><?php echo zen_output_string_protected($_SESSION['customer_first_name']); ?> <?php echo zen_output_string_protected($address['lastname']); ?>.</a></li>
    </ul>
    </div>


    Is there a cleaner way to paste code? This is my first time EVER on a development forum... I fear this will post completely unreadable.

    -Chris

  6. #6
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Customer Last Name

    Your code is using:
    Code:
    zen_output_string_protected($address['lastname'])
    how about trying the session variable you asked about:
    Code:
    $_SESSION['customer_last_name']
    See if that works better for you ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  7. #7
    Join Date
    Dec 2011
    Posts
    18
    Plugin Contributions
    0

    Default Re: Customer Last Name

    Sorry I posted the wrong code. That was some fail thread that said to call $address. Which didn't work.

    It was meant to be this:

    <div id="navMain">
    <ul class="back" style="color:#c50006">
    <?php if ($_SESSION['customer_id']) { ?>
    <li style="float:left; font-size:14px;"">Logged in as <a href="<?php echo zen_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>" style="padding:0px;"><?php echo zen_output_string_protected($_SESSION['customer_first_name']); ?> <?php echo zen_output_string_protected($_SESSION['customer_last_name']); ?>.</a></li>
    </ul>
    </div>

  8. #8
    Join Date
    Dec 2011
    Posts
    18
    Plugin Contributions
    0

    Default Re: Customer Last Name

    ... which still isn't working my end. :'(

  9. #9
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Customer Last Name

    Your code works great for me ...

    Can you peek in the:
    /includes/modules/pages/login/header_php.php

    do you have this code on around line 87:
    Code:
            $_SESSION['customer_last_name'] = $check_customer->fields['customers_lastname'];
    Can you check the account that you are working with and make sure that there is a lastname set on it?

    Could you also check in phpMyAdmin for the table:
    address_book

    and make sure that there is a last name in the field:
    entry_lastname

    for that customer?
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  10. #10
    Join Date
    Dec 2011
    Posts
    18
    Plugin Contributions
    0

    Default Re: Customer Last Name

    I have that exact code on my line 87 of header_php.php.

    Also checked there is definitely a lastname set. It shows up in the account settings and if I call the full address label.
    And it shows up in the Active Users in the site admin.

    Totally bamboozled!

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Last Name Issue when Customer has a middle initial...
    By Coins2012 in forum PayPal Express Checkout support
    Replies: 0
    Last Post: 30 May 2015, 07:38 PM
  2. How do I hide customer's last name on product reviews?
    By Bob88Vette in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 18 May 2010, 06:01 PM
  3. customer review first name last initial
    By shoesocks.com in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 23 Feb 2010, 06:24 AM
  4. BUG - Parenthesis in last name breaks customer lookup
    By thedust2010 in forum Bug Reports
    Replies: 2
    Last Post: 30 Jan 2007, 12:52 AM
  5. Admin Customer Name, First/Last reversed
    By Peace Freak in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 3 Sep 2006, 08:03 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR