Si vous constatez la perte de tickets, de commentaires ou de projets, veuillez consulter la page https://status.framasoft.org/incident/626.

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) { ...@@ -575,6 +575,17 @@ function cart_updateitem_hook (&$hookdata) {
array_unshift($params,$sql); array_unshift($params,$sql);
$r=call_user_func_array('q', $params); $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"])) { 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