jnunez Posted April 21, 2003 Share Posted April 21, 2003 How can I disable persistent shopping carts? So if I have a returning user and stuff he selected last week but never purchased doesn't not remain in his cart. Link to comment Share on other sites More sharing options...
M@rcel Posted April 21, 2003 Share Posted April 21, 2003 I did NOT test this, so start with making backups!! Open up catalog/includes/classes/shopping_cart.php Look for: // insert into database // if (tep_session_is_registered('customer_id')) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET . " (customers_id, products_id, customers_basket_quantity, customers_basket_date_added) values ('" . $customer_id . "', '" . $products_id . "', '" . $qty . "', '" . date('Ymd') . "')"); and change into: // insert into database // if (tep_session_is_registered('customer_id')) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET . " (customers_id, products_id, customers_basket_quantity, customers_basket_date_added) values ('" . $customer_id . "', '" . $products_id . "', '" . $qty . "', '" . date('Ymd') . "')"); Then find: // insert into database if (tep_session_is_registered('customer_id')) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " (customers_id, products_id, products_options_id, products_options_value_id) values ('" . $customer_id . "', '" . $products_id . "', '" . $option . "', '" . $value . "')"); And replace by: // insert into database if (tep_session_is_registered('customer_id')) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " (customers_id, products_id, products_options_id, products_options_value_id) values ('" . $customer_id . "', '" . $products_id . "', '" . $option . "', '" . $value . "')"); Or in short: Comment out the line after the comments that say '// insert into database'. It might just work :? Greetings from Marcel |Current version|Documentation|Contributions| Link to comment Share on other sites More sharing options...
M@rcel Posted April 21, 2003 Share Posted April 21, 2003 the second "replace by" should have two '//' in front of the second line :oops: :oops: Greetings from Marcel |Current version|Documentation|Contributions| Link to comment Share on other sites More sharing options...
jnunez Posted April 21, 2003 Author Share Posted April 21, 2003 In which function should this go in? ---- So far from tracing everything I thought I could easily just edit the class shoppingCart::reset so when called, it will wipe out the old data in the database and load the current data in the shopping cart to the db and then back to the cart. I know pretty repetative but this is just a temp solution so the higher up can approve it. Link to comment Share on other sites More sharing options...
M@rcel Posted April 21, 2003 Share Posted April 21, 2003 In function add_to_cart(). The comments (// insert into database) are already there. Just comment out the line directly following the comment (in two places). Greetings from Marcel |Current version|Documentation|Contributions| Link to comment Share on other sites More sharing options...
M@rcel Posted April 21, 2003 Share Posted April 21, 2003 You could also change login.php: Look for cart->restore_contents(); and right after that, you could call: cart->reset(true); This would wipeout the cart including the db. Greetings from Marcel |Current version|Documentation|Contributions| Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.