• Resolved marvelfreak

    (@marvelfreak)


    Hello,

    i need some help figure out how to disable session expire on cart

    Also i tried things to do with code no results

    add_filter( 'wc_session_expiring', 'woocommerce_cart_session_about_to_expire' );
    
    function woocommerce_cart_session_about_to_expire( $seconds ) {
    
    
    return 60 * 60 * 47;
    
    }
    
    
    add_filter( 'wc_session_expiration', 'woocommerce_cart_session_expires' );
    
    function woocommerce_cart_session_expires( $seconds ) {
    
    return 60 * 60 * 48;
    
    }

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Shameem R. a11n

    (@shameemreza)

    Hi @marvelfreak,

    It is not recommended to disable it entirely for security reasons. However, you can extend the duration of the session.

    The code you’ve shared should work correctly to extend the session expiration time, but please ensure it is placed in your child theme’s functions.php file.

    If it still doesn’t work, it might be due to a theme or plugin conflict. Try temporarily switching to a default WordPress theme or deactivating all other plugins to see if the issue persists. Also, make sure you use the classic cart block or shortcode on the cart page, as that code might not work with the cart block.

    For reference, these particular forums are meant to provide general support for the core functionality of WooCommerce itself. For development and custom coding questions, it’s best to ask for insight related to those on either the WooCommerce Advanced Facebook group or the WooCommerce Community Slack. Many of our developers hang out there and will be able to offer insights into your question. You can also seek help from the following:

    I wish I could help more, but hopefully, this gets you going in the right direction to get some further insight/information.

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – we’ll be here if and/or when you are ready to continue.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Woocommerce cart session’ is closed to new replies.