Does anyone have any idea of how clear all items in the shopping cart? I’m thinking of either a way to clear the users cache or a buttons that reloads the page and empties the shopping cart.
Can any one help with doing this please?? I don’t mind custom code or anthing. I just want a feature where I can clear basket as I get more and more clients who keep asking why the clear basket option is not integrated in the shopping cart. Any help please? @QA_Brandon@rileyrichter
Just to make sure I understand you correctly, I wanted to clarify. When you say “one product” do you mean one item in the cart? If that’s the case Webflow has a built in “Remove” button in the cart component. As seen here: Cart Component .
Or do you mean all the items in the cart that fall under one product? For example clear all sizes under the product “t-shirt”?
I needed to create a button that would remove products from the cart. Not a normal button, a button outside the cart that removes the selected product.
I updated my original post (see solution above) to show you how to access the tool. I ended up just making it a free tool in the Flow Phantom Dashboard. If you have issues setting up let me know!
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();
});
}