Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2007
    Location
    Vienna
    Posts
    38
    Plugin Contributions
    0

    help question $_SESSION['customer_last_name'] ??

    hey,

    okay, i have $_SESSION['customer_first_name'], but where can i find the family name?

    thx for any help!

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

    Default Re: $_SESSION['customer_last_name'] ??

    That is not built into Zen Cart as a session variable ... you would need to do a look up for that ...
    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
    Nov 2003
    Location
    Haarlem | Netherlands
    Posts
    1,987
    Plugin Contributions
    15

    Default Re: $_SESSION['customer_last_name'] ??

    I guess you already found it, but else I suggest you add it here:
    (module/pages/login/header_php.php)
    Code:
      // Check if email exists
      $check_customer_query = "SELECT customers_id, customers_firstname, customers_password,
                                        customers_email_address, customers_default_address_id,
                                        customers_authorization, customers_referral
                               FROM " . TABLE_CUSTOMERS . "
                               WHERE customers_email_address = :email";
    
      $check_customer_query  =$db->bindVars($check_customer_query, ':email', $email_address, 'string');
      $check_customer = $db->Execute($check_customer_query);
    
      if (!$check_customer->RecordCount()) {
        $error = true;
      } else {
        // Check that password is good
        if (!zen_validate_password($password, $check_customer->fields['customers_password'])) {
          $error = true;
        } else {
          if (SESSION_RECREATE == 'True') {
            zen_session_recreate();
          }
    
          $check_country_query = "SELECT entry_country_id, entry_zone_id
                                  FROM " . TABLE_ADDRESS_BOOK . "
                                  WHERE customers_id = :customersID
                                  AND address_book_id = :adressBookID";
    
          $check_country_query = $db->bindVars($check_country_query, ':customersID', $check_customer->fields['customers_id'], 'integer');
          $check_country_query = $db->bindVars($check_country_query, ':adressBookID', $check_customer->fields['customers_default_address_id'], 'integer');
          $check_country = $db->Execute($check_country_query);
    
          $_SESSION['customer_id'] = $check_customer->fields['customers_id'];
          $_SESSION['customer_default_address_id'] = $check_customer->fields['customers_default_address_id'];
          $_SESSION['customers_authorization'] = $check_customer->fields['customers_authorization'];
          $_SESSION['customer_first_name'] = $check_customer->fields['customers_firstname'];
          $_SESSION['customer_country_id'] = $check_country->fields['entry_country_id'];
          $_SESSION['customer_zone_id'] = $check_country->fields['entry_zone_id'];

  4. #4
    Join Date
    Feb 2007
    Location
    Vienna
    Posts
    38
    Plugin Contributions
    0

    Default Re: $_SESSION['customer_last_name'] ??

    yeah, i also used "includes/modules/pages/login/header_php.php"


    i simply added "customers_lastname" to $check_customer_query at line 44
    PHP Code:
    $check_customer_query "SELECT customers_id, customers_firstname, customers_password,
                                        customers_email_address, customers_default_address_id,
                                        customers_authorization, customers_referral, customers_lastname 
                               FROM " 
    TABLE_CUSTOMERS "
                               WHERE customers_email_address = :email"

    and at the "$_SESSION[...] =" part at line 77 i added that line:
    PHP Code:
          $_SESSION['customer_last_name'] = $check_customer->fields['customers_lastname']; 
    now at any point in the zencart i can write "<?php echo $_SESSION['customer_last_name']; ?>" to display the lastname


  5. #5
    Join Date
    Nov 2003
    Location
    Haarlem | Netherlands
    Posts
    1,987
    Plugin Contributions
    15

    Default Re: $_SESSION['customer_last_name'] ??

    Somehow I already expected you had done exactly that

 

 

Similar Threads

  1. Passing variables without $_SESSION
    By fred_tededmondsson in forum General Questions
    Replies: 1
    Last Post: 31 Oct 2011, 07:25 PM
  2. $_SESSION['zenid'] is empty
    By kRex in forum General Questions
    Replies: 1
    Last Post: 8 Feb 2009, 08:02 PM
  3. PHP / $_SESSION help please
    By Jeff G in forum General Questions
    Replies: 2
    Last Post: 6 Oct 2008, 06:17 AM
  4. Attributes $_POST or $_SESSION ????!!!
    By accurax in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 4 Oct 2008, 02:07 PM
  5. $_SESSION['cart']->show_total()
    By ink in forum General Questions
    Replies: 1
    Last Post: 24 Jan 2008, 04:10 PM

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