Account for null when no more cart items are present
This commit is contained in:
parent
b818e56954
commit
50757a2832
7
shop.sql
7
shop.sql
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user