Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 3 of 3

Thread: How to clear cart....?

  1. #1
    ontrack5 is offline Junior Member
    Join Date
    May 2010
    Posts
    5

    Default How to clear cart....?

    I'm using addtocart.aspx to add an item to the cart....however, if people hit the back button and submit again....the item is added again.

    How can I clear the cart before I add anything so I can be sure what I add is the only thing in there?

  2. #2
    AspDotNetStorefront Staff - Scott's Avatar
    AspDotNetStorefront Staff - Scott is offline Administrator
    Join Date
    Mar 2007
    Location
    Ashland, OR
    Posts
    2,390

    Default

    We don't have any built-in methods to clear out the cart, but you could use a SQL query easily enough. Just get the customer's customerID and then delete that customer's rows from the ShoppingCart table.

    I'd think pretty carefully before you decide to do that for sure though. What if it's a logged-in customer with 23 other items in their cart that they wanted to get as well? If suddenly their cart is empty, are they going to take the time to add it all again, or get irritated and leave?

  3. #3
    AspDotNetStorefront Staff - Scott's Avatar
    AspDotNetStorefront Staff - Scott is offline Administrator
    Join Date
    Mar 2007
    Location
    Ashland, OR
    Posts
    2,390

    Default

    Just another thought - are these just specific products that you only want them to have one of? If that's the case, just set the Restricted Quantity on those products to 1, and they can Back/Submit as many times as they want and they'll only get one, and other cart contents are safe.