0

I am trying to remove the content of carts after 5 minutes instead of the defined 48 hours of WooCommerce.

I have added the code below to my site

add_filter( 'wc_session_expiration', function($seconds){ return 300;} );
add_filter( 'wc_session_expiring', function($seconds){ return 299;} );

but nothing is happening, I even checked the wp_woocommerce_sessions table and see that the session_expiry of new entry is more than a day.

mujuonly
  • 11,370
  • 5
  • 45
  • 75
  • By default WooCommerce sets 48 hours. You need to set a custom function with plugin. https://stackoverflow.com/questions/17812123/set-woocommerce-cart-expiration – Aroganz Apr 12 '20 at 02:54
  • that's exactly what i did, added a custom function. But the filter hook is not working – Hassan Sheikh Apr 12 '20 at 02:57

0 Answers0