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?
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();
});
}