• Resolved nmd78

    (@nmd78)


    Using WPCode Snippets I can’t get the following code to change the cart holding time. I have it set to front end only and everywhere.

    add_filter(‘wc_session_expiring’, 180);
    add_filter(‘wc_session_expiration’ , 180);

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Mircea Sandu

    (@gripgrip)

    Hi @nmd78,

    That won’t work because you need to use a function as a callback to the add_filter function and in this case you are using an integer.

    The code in your case should look like this:

    add_filter('wc_session_expiring', function( $time ) { return 180; });
    add_filter('wc_session_expiration' , function( $time ) { return 180; });

    Please note that by default, WooCommerce has 47 hours for the first one and 48 hours for the second so I’m not sure about the effects of having the same value for both. The value there is in seconds so 180 will result in 3 minutes.

    Thread Starter nmd78

    (@nmd78)

    That’s worked a treat Mircea! Thank you so, so much!

    Thread Starter nmd78

    (@nmd78)

    Another question, is there any way to modify that code so that it only affects ‘inactivity’?

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Cart Holding Time’ is closed to new replies.