Guest Posted November 7, 2005 Share Posted November 7, 2005 Dear all, The shopping cart seems to remember what you have selected in a previous section... Scenario: Monday: I go to my shop, log myself in, put article A & B into the cart and finally I leave the shop Wednesday: I go back to the shop, put article C & D into the cart, click checkout, log myself in, then I see the shopping cart with product A, B, C & D. How can I do to have only article C & D? Many thanks for your answers, Matthieu Link to comment Share on other sites More sharing options...
Guest Posted November 8, 2005 Share Posted November 8, 2005 Please help.... Link to comment Share on other sites More sharing options...
boxtel Posted November 8, 2005 Share Posted November 8, 2005 Please help.... the cart contents is saved for signed in customers only. in the class shopping_cart.php, the products you add to the cart with function : function add_cart($products_id, $qty = '1', $attributes = '', $notify = true) { will also be inserted into the database with : 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 ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . $qty . "', '" . date('Ymd') . "')"); and 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 ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . (int)$option . "', '" . (int)$value . "')"); comment these 2 statements out in the class and the cart is no longer saved to the db. to make it clean, better comment out all queries involving TABLE_CUSTOMERS_BASKET_ATTRIBUTES and TABLE_CUSTOMERS_BASKET. Treasurer MFC Link to comment Share on other sites More sharing options...
Guest Posted November 8, 2005 Share Posted November 8, 2005 the cart contents is saved for signed in customers only. in the class shopping_cart.php, the products you add to the cart with function : function add_cart($products_id, $qty = '1', $attributes = '', $notify = true) { will also be inserted into the database with : 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 ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . $qty . "', '" . date('Ymd') . "')"); and 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 ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . (int)$option . "', '" . (int)$value . "')"); comment these 2 statements out in the class and the cart is no longer saved to the db. to make it clean, better comment out all queries involving TABLE_CUSTOMERS_BASKET_ATTRIBUTES and TABLE_CUSTOMERS_BASKET. Many many thanks, I'll do it. Best regards, Matthieu Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.