Colleagues.
I'm finalizing a virtual store, however the customer will work with inventory. The proposal is that after 20 minutes of idleness of that user, the products will be automatically deleted from the cart so inventory will not get stuck in a cart abandonment.
Deleting the data I'm doing with PHP and so far everything is ok. I also managed by CPanel to configure the cron task for my PHP script.
The cart records, I am storing the date in the DATETIME () field, how would I compare the date field with another 20 minutes and after that execute the delete query?
I thought of something like this:
SELECT DataAbertura, ADDTIME( DataAbertura, '1 0:20:0:0.0000' ) AS DataVinte
FROM 'loja