I have a wordpress website that allows non logged-in customers to order with the code below
global $woocommerce;
$woocommerce->session->set_customer_session_cookie(true);
The issue that I am facing right now is that the products left unordered are left in cart because all non-logged-in custumers share the same woocommerce session.
I am thinking of setting an expiry time to the session or the cart so that it can clear products in cart.
The code that I saw in: Woocommerce Set Cart Expiration Interval returns 72 hours in seconds
add_filter('wc_session_expiring', 'filter_ExtendSessionExpiring' );
add_filter('wc_session_expiration' , 'filter_ExtendSessionExpired' );
function filter_ExtendSessionExpiring($seconds) {
return 60 * 60 * 71;
}
function filter_ExtendSessionExpired($seconds) {
return 60 * 60 * 72;
}
Do you know how can I make the filter return every 15 minutes?
Any idea is appreciated. Thanks...