Remove all items from Shopping Cart

Hello Webflow users!

I was looking for a way to integrate a button into the designer that will clear the user’s shopping cart upon click. This button would be very useful for users who want to start fresh.

I know this would be a custom code solution… anyone have an idea as to how we could accomplish this together?

Thanks!

I’m trying to implement this… Did you have any luck doing it?

I did not, sorry! Would love to hear a solution though!

:wave: Hey I just wrote a script to do it on my site: Flow Phantom. You can try it out there.

See This thread on how to install

Let me know if there any issues with it, I’m happy to help!

Awesome! I’ll have to check it out. Thank you!

If you are displaying the ‘delete’ link on each individual item in the cart, you could just click on all of them from Javascript. For example, this function does it using jQuery:

    function deleteCartProducts() {
        $("[data-wf-cart-action=remove-item]").each(function () {
            // click the underlaying html element, not the jquery object
            $(this)[0].click();
        });
    }