How to add a cart remove button on my website?

Topic summary

A Shopify store owner needs help implementing a cart remove button on their website (www.fofill.se) and requires a same-day solution.

Initial Problem:

  • Expected to find the option in the template customization panel but discovered it requires custom Liquid code
  • Found sample code online but implementation attempts failed, redirecting to an error page

Attempted Solution:
Another user (shop_dev1) provided code to be added to a snippets file, including markup that renders an ‘icon-remove’ element. They clarified the icon rendering line can be replaced with custom icon code.

Current Status:
The discussion remains unresolved. After implementing the provided code and snippet, the remove button still doesn’t function properly—it refreshes the page without actually removing products from the cart or changing quantities. The original poster has requested further assistance to diagnose why this issue occurs.

Summarized with AI on November 22. AI used: claude-sonnet-4-5-20250929.

URL: www.fofill.se

Hi,
I’m trying to add a “cart remove button” on my site. I thought maybe it was a simple option I could change on the customize template panel. But it looks like something you have to add yourself in the liquid code…

Hoping someone could help me with this. Need it fixed today

I found this line of code on the internet:

{{ 'cart.general.remove' | t }}

I have tried to add it to our cart.item. liquid and cart.liquid, but it doesn’t work. It shows up, but the button redirects to an error page.

I would really appreciate some help!
Thank you!
Best regards, Robin

Hello @RobinOlofsson ,

Here is the code that fix your issue.


1 Like

Hi!
Thanks for the code. Do I put it in the cart.liquid (template) or cart.item.liquid (snippets)? And “reder icon-remove”, should that not link to an icon?
Thank you!

Hi

You have to add this code in snippets file.

{% render ‘icon-remove’ %} : This line is just rendering icon, you can put your own icon code here instead of it.

I added the code and the snippet. Somehow, it doesn’t remove the products in the cart. It just updates the page with the same quantity and no changes. Would you be able to take a look at it? Or do you know why this problem occurs?
Thank you!