Cart Deletes All Items

Topic summary

A user is experiencing an issue where removing a single item from their shopping cart causes all items to be deleted instead of just the selected one.

Code Context:

  • The implementation uses a Liquid template with a cart form
  • Includes quantity controls with increment/decrement buttons
  • Features a remove item link for each product

Problem Details:

  • The cart displays items correctly with images, titles, prices, and variant information
  • Each item has its own remove link ({{ item.remove_url }})
  • However, clicking remove on one item clears the entire cart

Current Status:

  • The issue remains unresolved with no responses yet
  • The code snippet shows the cart structure but the root cause of the deletion behavior is unclear
  • May require debugging the form submission logic or JavaScript handling the remove action
Summarized with AI on November 5. AI used: claude-sonnet-4-5-20250929.

Hello

When I remove 1 item from the cart, all items get removed

Here is my code:

Cart {{ 'cart.css' | asset_url | stylesheet_tag }}

{% form ‘cart’
, cart %}

{% for item in cart.items %}

{{ item.title }}

Unit Price: {{ item.price | money }}

Quantity:

-
+

Variant: {{ item.variant.title }}

Final Price: {{ item.final_line_price | money_without_currency }}

{% endfor %}
Checkout {% endform %} {{ 'cart.js' | asset_url | script_tag }}