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
|
||||
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user