Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2006
    Posts
    250
    Plugin Contributions
    0

    Default Logoff Without Emptying Cart

    I'm working on a modification where it would be advantageous to be able to log the user off without emptying their cart. I'm afraid I don't understand the dynamics at work too well, so I have a question.

    I've found that I can do this by nullifying their customer_id. Is this Kosher? Or will Bad Things Happen?

    Thanks for the help,
    Joe
    Now J_Schilz
    Integrated Checkout Without Account
    (wiki w/pics, demo, download)

  2. #2
    Join Date
    Jun 2003
    Posts
    33,715
    Plugin Contributions
    0

    Default Re: Logoff Without Emptying Cart

    Joe-

    If the user is logged in to start with, their cart is saved. If the customer is a guest then the cart is not saved when the session expires.
    Please do not PM for support issues: a private solution doesn't benefit the community.

    Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

  3. #3
    Join Date
    Jan 2004
    Posts
    66,380
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Logoff Without Emptying Cart

    Quote Originally Posted by KGZotU View Post
    I'm working on a modification where it would be advantageous to be able to log the user off without emptying their cart. I'm afraid I don't understand the dynamics at work too well, so I have a question.

    I've found that I can do this by nullifying their customer_id. Is this Kosher? Or will Bad Things Happen?
    Quote Originally Posted by Kim View Post
    If the user is logged in to start with, their cart is saved. If the customer is a guest then the cart is not saved when the session expires.
    To clarify ...
    1. the logged-in user has the customer_id set. When the session expires, it is blanked.
    2. the non-logged-in user never has it set.
    3. sessions expire after 24 minutes of inactivity
    4. whilst shopping, the cart is saved/updated every time they click to make adjustments
    5. if you blank the customer_id, you effectively log the customer out.
    Or you could just kill the session by calling zen_session_destroy(); (this is the most efficient way)
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  4. #4
    Join Date
    Mar 2006
    Posts
    250
    Plugin Contributions
    0

    Default Re: Logoff Without Emptying Cart

    Kim and DrByte,

    Thank you for the responses. It sounds like I'm not going to corrupt the system by blanking the customer ID.

    Kim, I should have provided a little more info. (; I'm trying to further the appearance that there is no account creation going on for my checkout without account mod. In this case, if a user has begun checking out without an account and then tries to enter a GV--through gv_redeem, the option to enter it during checkout is removed--then I want to give them an opportunity to create an account without having to execute a more conventional logoff and lose their cart contents.

    Nulling the customer ID and redirecting them to login, with message, seems to be doing the trick.

    Again, thank you both for your help.

    --Joe
    Now J_Schilz
    Integrated Checkout Without Account
    (wiki w/pics, demo, download)

 

 

Similar Threads

  1. v139f Add parameters to zen_draw_textarea_field() without emptying field
    By wolfderby in forum General Questions
    Replies: 2
    Last Post: 8 Jun 2014, 01:27 AM
  2. problem when emptying shopping cart
    By mgdesmond13 in forum General Questions
    Replies: 0
    Last Post: 11 Aug 2008, 05:16 PM
  3. Logoff 404 error without SSL
    By ahsengmusic in forum General Questions
    Replies: 5
    Last Post: 9 Sep 2007, 11:44 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