stephenmcd / cartridge

Ecommerce for Mezzanine
http://cartridge.jupo.org
BSD 2-Clause "Simplified" License
707 stars 299 forks source link

Delete cart on last cart item removed #316

Closed dsanders11 closed 7 years ago

dsanders11 commented 7 years ago

There's currently inconsistent behavior between setting the last cart item's quantity to 0 on the cart view, versus using the remove functionality. The latter deletes the cart as well, the former leaves the cart with no items.

When carts are set to hang around for a long time this leads to ghost carts building up in the DB. This is undesirable for a couple different reasons.

Fix is simple, just delete the cart if the last item was deleted via the quantity is 0 mechanism.

stephenmcd commented 7 years ago

Thanks guys