Remove items in cart
488705
def change_item(self, item_id, operation):
        

        product = Products().get_one(item_id)
        if product:
            if operation == 'add':
                self.items.append(product)
            elif operation == 'remove':
                cart_p = [x for x in self.items if x['id'] == product['id']]
                self.items.remove(cart_p[0])
            self.update()
            return True
        else:
            return False
170675
function RemoveItem($idx)
    {
        $result = array();
        foreach ($this->items as $currentIdx => $item)
        {
            if ($currentIdx != $idx)
                $result[] = $item;
        }
        $this->items = $result;
    }
268351
function( array, id, recurse ) {
			for ( var i = 0, item;
			( item = array[ i ] ); i++ ) {
				if ( item.id == id )
					return array.splice( i, 1 );
				if ( recurse && item[ recurse ] ) {
					var retval = removeById( item[ recurse ], id, recurse );
					if ( retval )
						return retval;
				}
			}
			return null;
		}
1053758
function removeItemsFromList(list, itemsToRemove) {
    var result = [];

    _.each(list, function (item) {
        var valid = true;
        for (var i = 0; i < itemsToRemove.length; i++) {

            // if the item match one of the items to remove don't includ it in the result list
            if (item.indexOf(itemsToRemove[i]) === 0) {
                valid = false;
                break;
            }
        }

        if (valid) {
            result.push(item);
        }
    });

    return result;
}
40941
def _remove_list_item(self, beacon_config, label):
        '''
        
        '''

        index = self._get_index(beacon_config, label)
        del beacon_config[index]
957142
def remove_obsolete_items(self):
        """"""
        self.rdata = [(filename, data) for filename, data in self.rdata
                      if is_module_or_package(filename)]
818488
def del_item(self):
        """"""
        item = self.current
        rectangle = self.items[item]
        self.canvas.delete(item, rectangle)
        if callable(self._callback_del):
            self._callback_del(item, rectangle)
809450
def delete(self, *items):
        
        self._visual_drag.delete(*items)
        ttk.Treeview.delete(self, *items)
496418
public function RemoveRestrictedItems()
    {
        // since this is a tcmsrecord list, we need to collect all valid ids, and the reload the list with them
        $aValidIds = array();
        $this->GoToStart();
        while ($oItem = &$this->Next()) {
            if ($oItem->IsPublic()) {
                $aValidIds[] = MySqlLegacySupport::getInstance()->real_escape_string($oItem->id);
            }
        }

        $query = 'SELECT `shop_shipping_type`.*
                  FROM `shop_shipping_type`
                 WHERE ';
        if (count($aValidIds) > 0) {
            $query .= " `shop_shipping_type`.`id` IN ('".implode("','", $aValidIds)."') ";
        } else {
            $query .= ' 1 = 0 ';
        }
        $query .= ' ORDER BY `shop_shipping_type`.`position`';
        $this->Load($query);
    }
1182532
public function emptyCart()
    {
        unset($this->cart->items);

        $this->update();

        $this->events->dispatch('laracart.empty', $this->cart->instance);
    }
721404
function removeThis()
    {
        $exportItems = $this->fetchItems();

        $db = eZDB::instance();
        $db->begin();
        foreach ( $exportItems as $item )
        {
            $item->remove();
        }
        $this->remove();
        $db->commit();
    }
1180571
function remove(item, list) {
  var i = list.indexOf(item);
  if (~i) list.splice(i, 1);
}
1247275
public function clearData()
    {
        $cart = Cart::where($this->cartIdentifier())->first();

        if ($cart) {
            $cart->delete();
        }
    }
917352
function() {
			localStorage.removeItem(constants.LOCAL_STORAGE_TEMP_RULES_KEY);
			localStorage.removeItem(constants.LOCAL_STORAGE_SELECTED_RULES_KEY);
			localStorage.removeItem(constants.LOCAL_STORAGE_SELECTED_CONTEXT_KEY);
			localStorage.removeItem(constants.LOCAL_STORAGE_SELECTED_CONTEXT_COMPONENT_KEY);
			localStorage.removeItem(constants.LOCAL_STORAGE_SELECTED_VISIBLE_COLUMN_KEY);
			localStorage.removeItem(constants.LOCAL_STORAGE_SELECTION_PRESETS_KEY);
			localStorage.removeItem(constants.LOCAL_STORAGE_CUSTOM_PRESETS_KEY);
		}
108514
private function cleanupCartsArray(&$cartsArray)
    {
        if ($cartsArray && count($cartsArray) > 0) {
            // handle cartsArray count is > 1
            foreach ($cartsArray as $index => $cart) {
                // delete expired carts
                if ($cart->getChanged()->getTimestamp() < strtotime(static::EXPIRY_MONTHS . ' months ago')) {
//                    $this->em->remove($cart);
                    continue;
                }

                // dont delete first element, since this is the current cart
                if ($index === 0) {
                    continue;
                }
                // remove duplicated carts
//                $this->em->remove($cart);
            }
        }
    }
702497
def remove_routes(self, item, routes):
        """"""
        for route in routes:
            items = self._routes.get(route)
            try:
                items.remove(item)
                LOG.debug('removed item from route %s', route)
            except ValueError:
                pass
            if not items:
                self._routes.pop(route)
                LOG.debug('removed route %s', route)
828564
def clear(self):
        """"""
        with self.lock:
            self.data.clear()
            self.items.clear()