Let’s say you are building a flow for Shopify and need to add multiple products to the cart. Everything is ready and you start testing.
Now you have 10 or more products in the cart and you need to remove them. One by one is taking too much time. One way would be by creating an AJAX request to the cart and deleting everything. You can find more info about this approach here. Once you add the code you can execute it once you are on the cart page or by adding a button on the cart page and clicking it. This approach was used by me in the past until I found a better and faster one.
The new approach is visiting a link and it will clear everything from the cart.
https://YOUR-STORE.myshopify.com/cart/clear
You just need to go to /cart/clear and everything will be removed, no need to add additional code. It just works
- Category:
- Shopify