Products in cart to be deleted periodically

Hi, I am trying to make E-Commerce site.

This might not be a common way, but I’m trying to delete products in a cart periodically if there are no actions made by users.

Currently, I have a field for online activity log like below.

And once users load any pages, this latest online time will be updated.

Based on the latest online time, if users did not take any actions for a day, I would like to delete the “Yes” which indicates products in cart.

The following image is how I set the data base change.


*temp uid and online user id are the same ID that I manage users
*The field of product individual stores the product information including a status of in cart.

I guess folloing part might be the cause.

Thank you for your help in advance!

If this is for the purpose of making it so that the inventory of the product is not altered because of the product sitting in a cart that a user has not made any actions to purchase, you may consider what some big e-commerce sites do, which is to show the items as still in the cart, but that they are no longer available if the actual inventory of the item makes it so there are none left…that way you wouldn’t need to run workflows periodically to remove items from the cart.

1 Like

Thank you for the attention and reply. Actually this is e-commerce for 2nd hand. Therefore, each inventory is an uique. That’s why I want to remove products from the cart periodically.

Doesn’t matter if the inventory is unique, as most every inventory system is built with the expectation that inventory is unique…but if you must delete them from the cart periodically you can run a recurring backend workflow to run every day or week month or year

but my recommendation of keeping it in the cart and flagging it as unavailable is good UX…imagine having spent time going through adding products to your cart to return to purchase to only find out that some, most or all products have been removed; it is not a good experience to have. What is better is seeing that products you added are no longer available to give you a chance to keep it in the cart or perhaps reach out to the seller to see if they may have more available (I know it’s second hand but still some sellers of second hand items will have more than one of the same type of thing like Levis Jeans).

1 Like

I got your point, I’ll consider about it. Thanks