VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: whitecollar on February 11, 2013, 05:14:44 AM

Title: Clear Cart after an hour or more
Post by: whitecollar on February 11, 2013, 05:14:44 AM
How to set timer to clear the cart? Some users leave product on the cart then get back on it after a few days. The problem is the product is out of stock and still order it. How can I set a time in clearing the cart maybe clear the cart after one day.

Thanks
Title: Re: Clear Cart after an hour or more
Post by: jenkinhill on February 11, 2013, 12:35:48 PM
Reduce  Session Settings in Joomla Configuration/System. Also ensure Joomla cache is off.
Title: Re: Clear Cart after an hour or more
Post by: whitecollar on February 12, 2013, 03:15:50 AM
My joomla cache is only 15minutes but still caching it the whole time. Kindly help me on this. I can't figure it out. Can I add some code on the cart?

[attachment cleanup by admin]
Title: Re: Clear Cart after an hour or more
Post by: GJC Web Design on February 12, 2013, 10:51:11 AM
You need to find out exactly where it's being cached - I assume the session but you need to check..

in components/com_virtuemart/helpers/cart.php there are public functions

function removeCartFromSession()

and

function emptyCart()

and

function emptyCartValues($cartData)

maybe call one of these with a Cron Job etc...