First time using store and have hit my first "WTF" moment.

Add items to cart - DONE :)

Checkout Page - Displaying items in cart, cost and tax etc. :)

Delete Items in Cart - Using the documented method - remove_items input field. I cannot remove individual items from cart.

<input type="checkbox" name="remove_items[{key}]" value="1" /> Remove {title}

I have this inside the {items} loop. Then before {/exp:store:checkout} I have:

<input type="submit" name="update_cart" value="Update Totals" class="btn" />
<input type="submit" name="empty_cart" value="Empty Cart" class="btn btn-danger" />
<input type="submit" name="next" value="Continue to Billing Details" class="btn btn-primary" />

Update Totals - DOES NOT WORK. Page refreshes but nothing changes

Empty Cart - DOES WORK!!

Before I go and dig further, can anyone who has successfully used a checkbox to delete items from an Expresso Store project confirm the code they used or point me in the right direction.

EE 2.7.2 + Store 2.0.3

  • I have not tested with 2.7.2 but {items}<input type="checkbox" name="remove_items[{key}]" value="1" />{/items} should indeed remove items when checked and the update cart button is clicked. Commented Oct 11, 2013 at 1:22
  • I'm sure it should and I cant believe it's a manual JS fix to address it. Pls keep me posted. Commented Oct 16, 2013 at 23:41

3 Answers 3


This has been fixed in Store 2.0.5.

If you are using an earlier version and can't upgrade right now, the problem is caused because Store was ignoring the remove_items array if no items array was submitted at all.

To work around this, you should simply be able to add this line inside the {items} loop in your checkout tag.

<input type="hidden" name="items[{key}][item_qty]" value="{item_qty}" />

That means an items parameter will be submitted, and Store will know to check for remove_items as well.


Just to expand on Justin's comment, I had this head scratcher too (assuming you've fallen into the same trap) and made a change request to Expresso.

I had a single form with the quantity and remove buttons on. Users clicked remove, it submitted the form, but the Store code took priority of the quantity and therefore ignored the remove.

I was using the following form code (shortened for simplicity):

<input type="text" maxlength="12" name="items[{key}][item_qty]" value="{item_qty}" size="2">
<input type="submit" name="remove_items[{key}]" value="1" class="delete_item" />

And it would fail due to the reasoning above - Note this is with Store v1.6.3

So I had to set the quantity to 0 when the user clicked remove.

//###   Delete Item from Basket - Send via Ajax   ###
$("form .delete_item").click(function(e) {
    if (confirm("Are you sure?")) {
        $(this).parents('tr').animate({ "opacity": "hide" }, "slow")
            .find('.quantity input[type="text"]').val(0);
        AjaxSubmit($(this), true);
  • 2
    Hmm interesting. The remove_items should definitely take priority over the item_qty field. I'll take a look into this shortly. Commented Oct 11, 2013 at 19:28
  • A first-party response would be cool. Commented Oct 16, 2013 at 23:42
  • Stuart - I've tried but can't replicate this at all. The remove_items checkbox and button both work perfectly on my test sites. Can you email [email protected] and reference this thread, I'd love to see it in action and get to the bottom of why this is happening. Commented Oct 21, 2013 at 17:59
  • I am having this exact same issue.Both remove_items and a submit button with value 0 don't work.
    – JonkBok
    Commented Oct 25, 2013 at 14:53
  • The above method is not working for me. When I manually put a 0 in the qty box and submit the form, it doest remove the item from the cart. When use val(0) via jquery, and submitting the form via jquery, the item is not removed from cart, strange enough...
    – JonkBok
    Commented Oct 26, 2013 at 15:12

Well, I was also looking for an answer for this particular issue. I am still fine tuning what I have but the logic is updating the quantity of the item on the checkout template to zero then update the cart totals, that will remove an item from the cart. Code looks like:

Checkout template: I added a link next to the quantity text field

     <input name="items[{key}][item_qty]" value="{item_qty}" class="input-mini item_qty" /> 
     <a href="#" class="remove-product">Remove</a>

JQuery Script: This updates the quantity of that item to zero and clicks the update cart button

         // click handler
     return false;   

If someone else has a better solution, you can share for all to benefit

  • just to mention, my solution was working for products without a minimum quantity set
    – William
    Commented Oct 11, 2013 at 10:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.