Re: Add an "clear the cart"-button to the cart page on Dawn theme

Solved

Add an "clear the cart"-button to the cart page on Dawn theme

karinorage
Shopify Partner
18 0 4

 

Does anyone have a code example to add an "empty the cart" or "clear the cart"-button to the Dawn theme, so that one can delete all items with one click.

I know Apps exists, but using several apps already I rather find a code solution.

 

Thanks,
Karin

Accepted Solution (1)

Guleria
Shopify Partner
3944 791 1120

This is an accepted solution.

Hello @karinorage ,

 

Use this 

<a href="/cart/clear">Clear cart</a>

 

Thanks

- Drop an email   if you are looking for quick fix or any customization
- Email: guleriathakur43@gmail.com Skype: live:navrocks1
- Try GEMPAGES a great page builder

View solution in original post

Replies 10 (10)

Guleria
Shopify Partner
3944 791 1120

This is an accepted solution.

Hello @karinorage ,

 

Use this 

<a href="/cart/clear">Clear cart</a>

 

Thanks

- Drop an email   if you are looking for quick fix or any customization
- Email: guleriathakur43@gmail.com Skype: live:navrocks1
- Try GEMPAGES a great page builder
karinorage
Shopify Partner
18 0 4

Thank you, Guleria.

That was quick and simple 👍

Totalmann
Tourist
12 0 1

Hi,

 

I have the same issue on the "refresh" theme. Would this work there also, and where whould I paste it?

 

thanks

karinorage
Shopify Partner
18 0 4

I think it would, Refresh is a Shopify theme, based on Dawn. I see in the demo it uses a drawer, so you might want look into the cart-drawer.liquid to add  the 

<a href="/cart/clear">Clear cart</a>

 in to. 

Totalmann
Tourist
12 0 1

tx for responding, but it dit not work putting it into cart-drawer.liquid. 

I tried like this

Totalmann_0-1689348266722.png

and like this:

 

Totalmann_1-1689348293259.png

 

karinorage
Shopify Partner
18 0 4

You must not put it in the section cart-drawer.liquid, but in the snippet: cart-drawer.liquid

Totalmann
Tourist
12 0 1

Hi,

 

I managed to get the button on the main overview for the cart by pasting it on line 29 in main-cart-items.liquid

Totalmann_2-1689349636420.png

 

However for the side bar there is no effect. That's the most important place to have it I think

Totalmann_4-1689349807556.png

 

 

 

karinorage
Shopify Partner
18 0 4

You must not put it in the section cart-drawer.liquid, but in the snippet  cart-drawer.liquid

Totalmann
Tourist
12 0 1

Ahh I see, and if I want it just above the ckeckout button, where would I put it?

Totalmann_0-1689352029099.png

 

Gadi_Rosales
Shopify Partner
3 0 0

on point! Thanks