@Override
	public void updateCart(UserModel user, int productId, int quantity)
			throws WebshopAppException {

		if (isValidUser(user, "UPDATE_CART")
				&& isPositiveQuantity(quantity, "UPDATE_CART")) {

			try (Connection conn = getConnection()) {

				deleteProductFromShoppingCart(conn, user, productId);

				if (quantity > 0) {
					insertProductQuantity(conn, user, productId, quantity);
				}

				Log.logOut(LOGGER, this, "UPDATE_CART",
						"Updated cart of user: ", user.getEmail(),
						" for product: ", String.valueOf(productId),
						" wtih a quantity of: ", String.valueOf(quantity));

			} catch (SQLException e) {
				WebshopAppException excep = new WebshopAppException(
						e.getMessage(), this.getClass().getSimpleName(),
						"UPDATE_CART");
				Log.logOutWAException(LOGGER, excep);
				throw excep;
			}
		}

	}