Changing the WooCommerce Shopping Cart Expiration Time
WooCommerce defaults to a 48 hour expiration time for all user’s carts. After this time, a user’s cart is deleted and the user will have to restock their basket with the same items before continuing to shop.
The default expiry time can be changed by using the wc_session_expiring and wc_session_expiration filters in your site’s functions.php. This is fine if your expiry time is at 12 hour intervals as the WordPress cron system only runs the session clean up twice daily and you also have to consider if you really want to hardcode cart expiry in your website’s code?
There is a plugin that takes care of all of these problems
- Gives you control of the cart expiration time directly from the WooCommerce system settings page
- It changes the WooCommerce session clean up to an hourly period to allow cart expiration times of greater or less than 12 hour intervals
- It is fully supported on multisite installations of WordPress and WooCommerce
Buying the plugin rather than making the changes to the WooCommerce system yourself gives you the following benefits:
- When the plugin is updated and new features are added you will receive an email update along
- Using the plugin to control the cart expiration instead of changing the code yourself means you can update WooCommerce without undoing your changes.
- You have the benefit of being part of a community of users actively using and providing feedback on improvements to the developers of the plugin.