I want to automatically empty complete Woocommerce cart from products after 5 minutes. Is there a way to programmatically do so?
Asked
Active
Viewed 677 times
1 Answers
0
First set a Session or cookie with current time on woocommerce_add_to_cart
hook.
Once page load, You can check with init
hook if difference between current time and session time is more then 300 second then you can clear cart.
global $woocommerce;
$woocommerce->cart->empty_cart();

Vicky P
- 553
- 6
- 12