Programmatically Remove All Cart Items

steeeeephensteeeeephen Member
in Help edited November 2007
Is this possible? A javascript solution would be excellente.
Comments
  • Or, a way to completely kill the cart session or anything like that. Any way to get rid of the cart contents is good.
  • lukeluke FoxyCart Team
    I don't see it as being a problem. I'll trac it for the next release. Something along the lines of ?cart=empty

    Which makes me wonder though... what will the user experience be? Would they just open up an empty cart? Maybe we figure out away to avoid displaying the cart all together using a POST via javascript. If you have any thoughts on how you'd like the user experience to go with an "empty my cart" function, let us know.

    What would you use this functionality for?
  • brettbrett FoxyCart Team
    Luke, to bring you up to speed, he's got a really slick implementation going on, and this is only a piece of it.
  • lukeluke FoxyCart Team
    edited November 2007
    Ah yes... knew that sounded familiar. Sorry about missing that one.

    Based on what I've read, it sounds like an ajax post will do the trick. You run some js, it loads up the cart and clears it out and everyone's happy. Shouldn't be a problem at all. Maybe we'll return "true" or something like that.
  • Thanks guys, the method you're describing for removing the cart contents sounds simple and perfect.

    You guys rule.
  • I just wrote this to Brett via email as well...but the "clear cart when adding" is an essential function for my situation as well. People are buying 1 thing, one at a time, without the cart at all.

    Thanks for the great work,
    Matt
  • lukeluke FoxyCart Team
    Ahh... even easier. A flag to clear the cart on every add. That's nice because it doesn't require a separate ajax post. We'll work into an upcoming version.
  • Luke,

    Yes, something like you mentioned before would work for me:

    https://YOURDOMAIN.foxycart.com/cart?name=Product 1&price=5&cart=empty

    Hopefully that helps steeeeephen's case as well.

    I know this is the dreaded software development question, but any idea when that upcoming version will be released? I'm assuming not the next week or so, right?

    Thanks,
    Matt
  • lukeluke FoxyCart Team
    The holiday season slows things up quite a bit, but we'll get back into the swing of things early next year. We'll make sure this change makes our next release as there's obviously some need for it.
Sign In or Register to comment.