Account for null when no more cart items are present

This commit is contained in:
Thastertyn 2024-03-07 22:37:28 +01:00
parent b818e56954
commit 50757a2832

View File

@ -121,10 +121,11 @@ after delete
on cart_item for each row on cart_item for each row
begin begin
update cart update cart
set price_total = ( set price_total = ifnull(
select sum(price_subtotal) (select sum(price_subtotal)
from cart_item from cart_item
where cart_id = old.cart_id where cart_id = old.cart_id),
0.00
) )
where id = old.cart_id; where id = old.cart_id;
end; end;