• Resolved darthczyz

    (@darthczyz)


    Hi Richard,

    I was wondering if you knew anything about the checkout/cart variables. I can login, and add items to the cart, and see that they’re there. However, when I logout, the items are still in the cart. Do you know if Magento does something extra during the logout process that is not covered by Mage::getSingleton(“customer/session”)->logout(); ? Or do I need to load specific sessions into the customer/session variable to restore/unload the cart? Thanks for any help. I know this is probably beyond the mage enabler plugin, but it’s the last piece I’d like to plug in to my site.

    Thanks,
    Chris

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Richard Feraro

    (@richardferaro)

    I think the login doesn’t delete the cookie where the Magento session is tied up. You have to truncate the cart also when you call the logout method.

    See http://mysillypointofview.richardferaro.com/2009/04/13/how-to-delete-a-quote-in-magento/

    Thread Starter darthczyz

    (@darthczyz)

    Thanks Richard! I’ll try that out.

    Thread Starter darthczyz

    (@darthczyz)

    OK, so now they are all getting erased on logout, meaning the next user does not have any in his cart when he logs in. However, when the original user logs back in, they’re all gone too. I’d really like it if you could add some stuff to your cart, logout, then log back in and see your cart again. I think that’s the default Magento behavior. So I guess I’m looking for a way to associate a checkout/session with a particular customer. Is there something different I need to be doing at login to set the quote ID for the current customer?

    Chris

    Plugin Author Richard Feraro

    (@richardferaro)

    Then query again all cart/quote IDs related to the customer and get the most recent. It only deletes the session, not those stored in the database.

    Thread Starter darthczyz

    (@darthczyz)

    OK, thanks again for all of your help!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: Mage Enabler] Customer session variable’ is closed to new replies.