olaf
Wed 19 April 2006, 10:51 pm GMT +0300
I got several mails about error's like that:
Warning: sprintf(): Too few arguments in db_cart_class.php on line 93 (or line 92).
I noticed that the method "remove_old_orders" is a little wrong. I modified the code into this and should work now:
This bugfix will be available in the next release (version 1.12).
Warning: sprintf(): Too few arguments in db_cart_class.php on line 93 (or line 92).
I noticed that the method "remove_old_orders" is a little wrong. I modified the code into this and should work now:
Quote
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);
}
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);
}
This bugfix will be available in the next release (version 1.12).