Deletion Time Of Abandoned / Live Carts

Hello,



the abandoned / live carts do get deleted after some time.

Where can this deletion time be configured? What file do i have to edit?



best regards,

Alex

Hello,



app/functions/fn.init.php



if (fn_is_expired_storage_data('cart_products_next_check', SECONDS_IN_HOUR * 12)) {
db_query("DELETE FROM ?:user_session_products WHERE user_type = 'U' AND timestamp < ?i", (TIME - SECONDS_IN_DAY * 30));
}




Try to increase the number 30. Please note, do not place too great a number, it can affect performance.



Thank you.

Hi, good reply !



If I want the cart to expire after 1 day (products can vary significantly in price) should I put SECONDS_IN_DAY * 1 ???

[quote name='AntonioGrazioli' timestamp='1434723087' post='219588']

Hi, good reply !



If I want the cart to expire after 1 day (products can vary significantly in price) should I put SECONDS_IN_DAY * 1 ???

[/quote]



You are right!

i tried putting 1 but after more than 2 days all products are still in cart…should I enable cart expiry somewhere?

I have tried deleting my abandoned cart (from admin backend) but the cart gets recreated …cookie???

Note that this is updated when the user is logged in regardless of whether you view the cart or not. The cart is loaded into the user's session so it's valid (and the timestamp is updated) until they are no longer there.



Only way to check this is to add an item to a test user's cart. Then logout. Then check the database N days later to see that the cart has been removed. Login as that user and they should have no cart.

I believe the there's a cookie that recretaes the session.

I had a cookie time of one week, so even after deleting the cart content manualy from backend (abandoned carts), loggin again into the webiste caused the session to be recreated , presumibly from the cookie itself.

I have now set cart deletion afte 1 day and cookie duration 1 day…seems to be working…