Woocommerce Cart lifetime is indefinite – timeout does not clear items
WordPress 5.4.1
woocommerce 3.4.5
Items remain in our cart indefinitely until the order is completed, the problem is that an order was recently left in a users’ cart for several days and once completed the order retained the original date, which causes problems.
I’ve tried adding various ‘wc_session_expiring’ hooks to functions.php but nothing seems to help.
Currently I have this:
// basket timeout
//define the wc_session_expiring callback
function filter_wc_session_expiring( ) {
return 60*60*48; //
};
// define the filter_wc_session_expiration callback
function filter_wc_session_expiration( ) {
return 60*60*47; //
};
// add the filter
add_filter( 'wc_session_expiring', 'filter_wc_session_expiring', 10, 1 );
add_filter( 'wc_session_expiration', 'filter_wc_session_expiration', 10, 1 );
It’s not helping though, this does seem to reduce the cart cookie lifetime ‘wp_woocommerce_session_…’ so the problem seems to be that the clearance isn’t being triggered, maybe?
Leave an answer
You must login or register to add a new answer .