When a second copy of an item is dropped onto my cart, I bump the count on the previous item and delete the new item. The code that computes the cost of the cart then sees one item with a count of 2. When another copy is dropped, the count on the item already in the cart is back to 1. Any idea why? The code in question is in the dndDrop event handler: dojo.connect(cart, "onDndDrop", function(source, nodes, copy, target) { cartDrop(source, nodes); }); dojo.connect(trash, "onDndDrop", function(source, nodes, copy, target) { cartDrop(source, nodes); }); cart, trash and added_id are globals. function cartDrop(source, nodes) { var total = 0; var cartItems = cart.getAllNodes(); console.debug(ts()+"Checking for multiple "+added_id); // See if the item being added is already in the cart. var cartItems = cart.getAllNodes(); var count = 0; var not_the_first = false; var first_index; console.debug("#cart items:"+cartItems.length); for (var i=0; i