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

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

thekenstar
Explorer
66 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 4 (4)

tim
Shopify Partner
3764 351 1384

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
66 0 16

That did work, thank you. @tim 

dhruv4
Visitor
1 0 0

Where do I insert this code @tim .

Thanks

tim
Shopify Partner
3764 351 1384

If your theme has "Custom liquid" section/block, you can use it and paste the code there in theme Customizer.

Otherwise you'd need to edit cart section code, but it's different for each theme.

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