diff --git a/shop.sql b/shop.sql index 30ea0cf..b085cde 100644 --- a/shop.sql +++ b/shop.sql @@ -121,10 +121,11 @@ after delete on cart_item for each row begin update cart - set price_total = ( - select sum(price_subtotal) + set price_total = ifnull( + (select sum(price_subtotal) from cart_item - where cart_id = old.cart_id + where cart_id = old.cart_id), + 0.00 ) where id = old.cart_id; end;