If you want the shopping cart to empty of old products from a previous login ... but not lose the current sessions of products that the customer has been shopping for the last hour ...
Edit the file:
/includes/modules/pages/login/header_php.php
Comment out the restore and add the cleanup:
Code:
// restore cart contents
// $_SESSION['cart']->restore_contents();
// empty old cart products
$_SESSION['cart']->cleanup();
This is the cleanest method that I can find to manage the cart content when:
1 guest is shopping and hits Checkout ... goes to login and has an existing account and old products in cart
2 guest shopping and hits login to create an account
3 guest is shopping and hits login to create an account and goofs and is changed to create_account
4 guest is shopping and hits login to existing account with old cart of products
In all scenarios, all that will be in the shopping_cart following the successful login or create account will be products from the current session ...
All old products from a previous session will be removed silently in the background ...
No, no ... no need for applause ... just send money ... B)
Bookmarks