Kill the googlebot
Posts: 6
40 credits Members referred : 0
« on: Sep 14, 2006, 08:45:37 AM »
Hi Olaf,
I'am succesfully using your db_class for my shoppingcart. I have one problem: When a user fills his shopping cart (i use the cart with NO customerstable) and then exits the browser without deleting or bying the order a empty trace exists in the database tables. How ca i resolve that problem ??
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6301
38632 credits Members referred : 374
It's time to use PHP5!
« Reply #1 on: Sep 14, 2006, 08:49:02 AM »
the only way to do this is that the user has to login first, without customer information there is no chance. The class is using a database and not cookies...
Kill the googlebot
Posts: 6
40 credits Members referred : 0
« Reply #2 on: Sep 14, 2006, 10:14:19 AM »
Yes i know that, but i mean the order tables. Also when i use random customnumbers as if there was a customer the order rows, order and shipment table are left half filled when i exit the browser.
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6301
38632 credits Members referred : 374
Yes i know that, but i mean the order tables. Also when i use random customnumbers as if there was a customer the order rows, order and shipment table are left half filled when i exit the browser.
there is this kind of function (don't see the problem)
Code:
<?php function remove_old_orders($customer, $remove_only_zeros = true) { if (RECOVER_ORDER && $customer > 0) { $sql = sprintf("DELETE FROM %s WHERE open = 'y' AND customer = %d AND order_date < (NOW() - %d)", ORDERS, $customer, VALID_UNTIL * 86400); } else { $sql = sprintf("DELETE FROM %s WHERE open = 'y' AND order_date < (NOW() - %d)", ORDERS, VALID_UNTIL * 86400); } $sql .= ($remove_only_zeros) ? " AND customer = 0" : ""; mysql_query($sql); }
Kill the googlebot
Posts: 6
40 credits Members referred : 0
« Reply #6 on: Sep 14, 2006, 05:42:29 PM »
Greate, now i discovered my problem. In your class you call remove_old_orders after get_order. Now when i use customer as 0 the remove_old_orders delete's the new order again. Thats also whats leaving the empty records in the database. If i comment out the remove fun tion it works fine.
By the way, is there a good reason why you don't remove the rows and shipment record that belong to the "old" order ??
« Last Edit: Sep 14, 2006, 05:54:02 PM by bavo »
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6301
38632 credits Members referred : 374