When I create a cart and do not complete my order, say i added an item to the cart and closed the browser from there. Next day or after few hours when I open the site, that item still exists in my cart.
How can I unlink cart from session or destroy basketId cookie after say 30 minutes if the session remains inactive.
You could grab the current basket for the customer by using GetBasket and then check how old it is. If it's older than you want you execute ClearBasketInformation which gives you a new basket.
uCommerce doesn't have a configuration option for how long a basket should be retained. It simply defaults to 30 days.
And then compare the created date attribute with the current date and time. If 30 mins has passed you trigger clear basket. You can embed this code as part of an entry page.
If you're more comfortable with .NET you could use global.asax and check for expired baskets whenever a new request begins.
destroying session / basketid
Soren
When I create a cart and do not complete my order, say i added an item to the cart and closed the browser from there. Next day or after few hours when I open the site, that item still exists in my cart.
How can I unlink cart from session or destroy basketId cookie after say 30 minutes if the session remains inactive.
Nauman
You could grab the current basket for the customer by using GetBasket and then check how old it is. If it's older than you want you execute ClearBasketInformation which gives you a new basket.
uCommerce doesn't have a configuration option for how long a basket should be retained. It simply defaults to 30 days.
Soren
Please let me know how to use ClearBasketInformatio() either in xslt or in .Net code.
Regards
Nauman
You would load the basket using:
And then compare the created date attribute with the current date and time. If 30 mins has passed you trigger clear basket. You can embed this code as part of an entry page.
If you're more comfortable with .NET you could use global.asax and check for expired baskets whenever a new request begins.
is working on a reply...