Any reason why running `Spree::Order.where("create...
# support
s
Any reason why running
Spree::Order.where("created_at < ? and state='cart'", 45.days.ago).destroy_all
as a nightly job would be a bad idea? We have some customers coming back after a looong time and then they end up having goofy carts with out-of-stock line items and so on.
a
Keeping your discussion in mind, it might be a good idea to "expire" a cart and add a before callback on an order's load that if it is expired, it should be checked for it's line_items being up-to-date and then load the order, otherwise expire it (line_item or order whichever works better). It will be alittle code but this will sit well with all parties.
👍 1
s
Also a good option, thanks!
🙏 1