Commit dfbe8eaf authored by Mario's avatar Mario

if there are no items left for an order, delete the order

parent b0379ff1
......@@ -575,6 +575,17 @@ function cart_updateitem_hook (&$hookdata) {
array_unshift($params,$sql);
$r=call_user_func_array('q', $params);
if($dodel) {
$r = q("select * from cart_orderitems where order_hash = '%s'",
dbesc($order["order_hash"])
);
if(! $r) {
q("delete from cart_orders where order_hash = '%s'",
dbesc($order["order_hash"])
);
}
}
}
if (isset($item["item_meta"])) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment