Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2011
    Posts
    4
    Plugin Contributions
    0

    Default Current Customer / Sessions

    I'm having trouble finding information about customer sessions. If I wanted to code a page where the user could click a button and get an e-mail listing how many products they have bought (or any arbitrary information from their personal account/database table) would I locate the current user by looking into the session information? If not, how might I be able to access the current customer to do mySQL look-ups on their account information?

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

    Default Re: Current Customer / Sessions

    The customers_id is references as:
    $_SESSION['customer_id']

    when the customer is logged in ...
    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!]
    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
    Feb 2011
    Posts
    4
    Plugin Contributions
    0

    Default Re: Current Customer / Sessions

    So just to be clear- also I apologize if this sounds stupid, as I'm not very familiar with web dev- you can access the customer id from that reference from any php file in the server's zen cart folder. i.e. i could just type

    echo $_SESSION['customer_id']

    as the body for a page linked to the sidebar and it would print the customer's id? (although printing info is not necessarily my goal)

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

    Default Re: Current Customer / Sessions

    Yes, the current logged in customer can be checked with the:
    $_SESSION['customer_id']

    and when 0, then the customer is not logged in ...
    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!]
    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!

 

 

Similar Threads

  1. Check to see if current customer purchased specific product.
    By camerondied in forum Code Collaboration
    Replies: 2
    Last Post: 21 Jan 2016, 07:07 PM
  2. v151 Customer sessions not ending
    By jeking in forum General Questions
    Replies: 2
    Last Post: 3 Nov 2015, 02:08 AM
  3. Replies: 0
    Last Post: 13 May 2015, 02:22 PM
  4. Replies: 3
    Last Post: 15 Feb 2012, 11:28 AM
  5. Replies: 4
    Last Post: 29 Aug 2010, 01:49 PM

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