Remove item from cart Ok, I'm getting pretty crazy here. I'm trying to remove a variant from the cart. Adding works fine, like this:
&lt;input type=&quot;hidden&quot; name=&quot;purchasableId&quot; value=&quot;{{ variant.id }}&quot; id=&quot;{{ variant.sku }}&quot;&gt;
&lt;input type=&quot;submit&quot;&gt;

(variant is an item from product.variants)
However, when I want to remove an item, I do it like this:
&lt;input type=&quot;hidden&quot; name=&quot;lineItems[{{ variant.id }}][qty]&quot; value=&quot;0&quot;&gt;
&lt;input type=&quot;submit&quot;&gt;

But nothing gets removed. The weird thing is, when I query for lineItems, there's an item with the id &quot;92&quot;. The id from the variant is 19874. So that's the id I use in the hidden qty field. I have absolutely no idea where this 92 comes from. It is not the variant id. It's alo snot the product id. I don't know what it is. What am I doing wrong here?
You can remove a line item by including a remove parameter in the request. This example adds a checkbox the customer can use to remove the line item from the cart:
{% set cart = craft.commerce.carts.cart %}
&lt;form method=&quot;post&quot;&gt;
    {{ csrfInput() }}
    {{ actionInput('commerce/cart/update-cart') }}
    {% for item in cart.lineItems %}
        &lt;input type=&quot;number&quot; name=&quot;lineItems[{{ item.id }}][qty]&quot; min=&quot;1&quot; value=&quot;{{ item.qty }}&quot;&gt;
        &lt;input type=&quot;text&quot; name=&quot;lineItems[{{ item.id }}][note]&quot; placeholder=&quot;My Note&quot; value=&quot;{{ item.note }}&quot;&gt;
        &lt;input type=&quot;checkbox&quot; name=&quot;lineItems[{{ item.id }}][remove]&quot; value=&quot;1&quot;&gt; Remove item&lt;br&gt;
    {% endfor %}
    &lt;button type=&quot;submit&quot;&gt;Update Line Item&lt;/button&gt;
&lt;/form&gt;

You can check more on this on craft commerce documentation by using below link.
https://craftcms.com/docs/commerce/3.x/orders-carts.html#carts