Changing the WooCommerce Shopping Cart Expiration Time

Buy the WooCommerce Cart Expiration Plugin here

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

  1. Gives you control of the cart expiration time directly from the WooCommerce system settings page
  2. It changes the WooCommerce session clean up to an hourly period to allow cart expiration times of greater or less than 12 hour intervals
  3. It is fully supported on multisite installations of WordPress and WooCommerce

You can purchase the woocommerce cart expiry time changing plugin here

Buying the plugin rather than making the changes to the WooCommerce system yourself gives you the following benefits:

  1. When the plugin is updated and new features are added you will receive an email update along
  2. Using the plugin to control the cart expiration instead of changing the code yourself means you can update WooCommerce without undoing your changes.
  3. 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.

Help other people find this

3 Responses to “Changing the WooCommerce Shopping Cart Expiration Time”

  1. Richard T says:

    Thanks for sharing this Mark. I was having real problems getting my WooCommerce installlation to recognize an hourly update period, I bought the plugin and it worked straight away without and messing around. It was worth the money for the time saved 🙂

  2. Josep V says:

    Is it possible to set minutes instead of hours? For example, would it work setting 0,05 to change the cart expiration time to 5 minutes?

    • Mark says:

      I’m afraid not. There is a WooCommerce cron job that runs hourly to clear expired carts, I’ve not yet worked out how to change this and still work with this approach.

Leave a Reply

Your e-mail address will not be published. Required fields are marked *