Skip to content

Instantly share code, notes, and snippets.

@woogists
Last active July 14, 2022 12:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save woogists/0dae398745217996737672619135118b to your computer and use it in GitHub Desktop.
Save woogists/0dae398745217996737672619135118b to your computer and use it in GitHub Desktop.
[WooCommerce Core] Change default cart session length
<?php
// Sets when the session is about to expire
add_filter( 'wc_session_expiring', 'woocommerce_cart_session_about_to_expire');
function woocommerce_cart_session_about_to_expire() {
// Default value is 47
return 60 * 60 * 47;
}
// Sets when the session will expire
add_filter( 'wc_session_expiration', 'woocommerce_cart_session_expires');
function woocommerce_cart_session_expires() {
// Default value is 48
return 60 * 60 * 48;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment