public void addItem(String productId, BigDecimal quantity) throws CartItemModifyException, ItemNotFoundException {
trace("add item", productId + "/" + quantity);
try {
Delegator delegator = cart.getDelegator();
GenericValue product = null;
ProductConfigWrapper pcw = null;
product = delegator.findByPrimaryKeyCache("Product", UtilMisc.toMap("productId", productId));
if (UtilValidate.isNotEmpty(product) && "AGGREGATED".equals(product.getString("productTypeId"))) {
// if it's an aggregated item, load the configwrapper and set to defaults
pcw = new ProductConfigWrapper(delegator, session.getDispatcher(), productId, null, null, null, null, null, null);
pcw.setDefaultConfig();
}
//cart.addOrIncreaseItem(productId, null, quantity, null, null, null, null, null, null, null, null, null, null, null, null, session.getDispatcher());
cart.addOrIncreaseItem(productId, null, quantity, null, null, null, null, null, null, null, null, pcw, null, null, null, session.getDispatcher());
} catch (ItemNotFoundException e) {
trace("item not found", e);