private boolean checkQuantity(Item item, Order cOrder, int quantity, boolean checkCart) throws Exception {
        ItemStack is = cOrder.getItem(item.getId());
        int checkQt = quantity;
        if (is != null && checkCart) {
            checkQt += is.quantity; // we have to check quantity summing items already in cart
        }
        if (checkQt <= 0) {
            return false;
        } else if (checkQt == 1 || !(item instanceof QAvailability)) {
            if (!item.isAvailable()) {
                throw new Exception("This item is not available!");
            }
        } else {
            if (!((QAvailability) item).isAvailable(checkQt)) {
                throw new Exception("This quantity is not available!");
            }
        }

        return true;
    }