Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2006
    Posts
    298
    Plugin Contributions
    0

    Default Keep Cart clear cookie at logoff

    I'm using the Keep Cart mod on a 1.3.9 cart. Does anyone know how I can set it so that the cart cookie clears on the logoff page? Once the user has logged in, the items are saved in their user cart, so at logoff, the cookie should clear.

    The cart cookie doesn't always clear after order confirmation either, so some users end up merging their last order with their current order and get ticked off.

    Any help would be appreciated.

    Thanks.

  2. #2
    Join Date
    Jun 2006
    Posts
    298
    Plugin Contributions
    0

    Default Re: Keep Cart clear cookie at logoff

    Of course, as soon as I post, I figured it out.

    /includes/classes/observers/class.savecart.php

    Code:
    $zco_notifier->attach($this, array('NOTIFY_HEADER_END_CHECKOUT_CONFIRMATION','NOTIFY_HEADER_START_LOGOFF'));
    Code:
    				case 'NOTIFY_HEADER_END_CHECKOUT_CONFIRMATION':
    					setcookie('cart', '', time()-1000,"/",(zen_not_null($current_domain) ? $current_domain : ''));
    					setcookie('cartkey', '', time()-1000,"/",(zen_not_null($current_domain) ? $current_domain : ''));
    					break;
    				case 'NOTIFY_HEADER_START_LOGOFF':
    					setcookie('cart', '', time()-1000,"/",(zen_not_null($current_domain) ? $current_domain : ''));
    					setcookie('cartkey', '', time()-1000,"/",(zen_not_null($current_domain) ? $current_domain : ''));
    					break;
    Last edited by abcisme; 11 Jan 2015 at 02:43 PM.

 

 

Similar Threads

  1. Clear Shopping cart
    By tx_Rustler in forum General Questions
    Replies: 7
    Last Post: 4 Apr 2010, 04:32 PM
  2. Clear all items in the cart
    By mcb in forum Managing Customers and Orders
    Replies: 2
    Last Post: 19 Jul 2007, 09:50 AM
  3. Logoff Without Emptying Cart
    By KGZotU in forum General Questions
    Replies: 3
    Last Post: 4 Mar 2007, 06:48 AM

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