Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2014
    Location
    Denmark
    Posts
    27
    Plugin Contributions
    0

    Default Check if customer is logged in

    Is there a foolproof way of checking whether a customer is logged in? I had hoped $_SESSION['customer_id'] would do the job, but when checking out with COWOA this variable is set once the customer has entered the billing address.

    Background: I've made a row of custom buttons to be displayed at all times. Which buttons should show depends on whether a customer is logged in, and it's not so good that a COWOA customer would appear as having an account and being logged in as soon as they've gone through the first step of supposedly account-less checkout.

  2. #2
    Join Date
    Dec 2007
    Location
    Payson, AZ
    Posts
    1,076
    Plugin Contributions
    15

    Default Re: Check if customer is logged in

    Quote Originally Posted by flyvholm View Post
    Is there a foolproof way of checking whether a customer is logged in? I had hoped $_SESSION['customer_id'] would do the job, but when checking out with COWOA this variable is set once the customer has entered the billing address.

    Background: I've made a row of custom buttons to be displayed at all times. Which buttons should show depends on whether a customer is logged in, and it's not so good that a COWOA customer would appear as having an account and being logged in as soon as they've gone through the first step of supposedly account-less checkout.
    if your using the current version of COWOA then you would do the same as what's required for login...

    Code:
    <?php if ($_SESSION['customer_id'] && (!$_SESSION['COWOA']=='True')) { ?>  
    A customer is logged on button code here...
    <?php } else {  ?>
    not a customer button code here...
    <?php } ?>
    Dave
    Always forward thinking... Lost my mind!

  3. #3
    Join Date
    Jul 2014
    Location
    Denmark
    Posts
    27
    Plugin Contributions
    0

    Default Re: Check if customer is logged in

    Dave,

    Thanks a lot for your prompt and accurate reply. So far that appears to work exactly the way I had hoped. I should have been able to figure that out for myself, but at least now the answer can be found here and may perhaps save somebody else some time.

 

 

Similar Threads

  1. Check if admin is logged in?
    By rocoso in forum General Questions
    Replies: 3
    Last Post: 5 May 2009, 02:47 AM
  2. PHP How do we check for logged in?
    By bumba000 in forum General Questions
    Replies: 7
    Last Post: 4 Sep 2008, 05:56 AM
  3. Check if a user logged in?
    By yellow1912 in forum General Questions
    Replies: 1
    Last Post: 5 Jul 2007, 01:40 PM
  4. Check Logged In
    By okibi in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 17 Apr 2007, 01:35 PM
  5. Check if the user is logged in?
    By Rowan in forum General Questions
    Replies: 10
    Last Post: 28 Jun 2006, 07:30 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