Add Clear/Empty Cart Button to Cart Page - Empire Theme

thekenstar
Explorer
65 0 16

Is there a way to add a button to the cart page that would clear/empty the cart so that you dont have to click the X one by one on each item you want to remove from the cart? This is for the Empire theme. Attached is a screenshot of the cart page. Thank you for your help.

 

Screenshot 2024-04-11 at 1.37.41 PM.png

Replies 2 (2)

tim
Shopify Expert
3469 280 1286

If your theme gives you "Custom liquid" block/section, you can use the following code:

<a class="button-secondary" href="{{- routes.cart_url -}}/clear">
      Empty cart
</a>

 

If my post is helpful, consider liking it -- it will help others with similar problem to find a solution.
I can be reached via e-mail tairli@yahoo.com
thekenstar
Explorer
65 0 16

That did work, thank you. @tim