// Other adjustments like promotional price should be added to the cart independent of
// the ship group.
// We're creating the cart right now using data from the quote, so there cannot yet be more than one ship group.
List<GenericValue> cartAdjs = cart.getAdjustments();
CartShipInfo shipInfo = cart.getShipInfo(0);
List<GenericValue> adjs = orderAdjsMap.get(quoteId);
if (adjs != null) {
for (GenericValue adj : adjs) {
if (isTaxAdjustment( adj )) shipInfo.shipTaxAdj.add(adj);
else cartAdjs.add(adj);
}
}
// The cart item adjustments, derived from quote item adjustments, are added to the cart
if (quoteItems != null) {
Iterator<ShoppingCartItem> i = cart.iterator();
while (i.hasNext()) {
ShoppingCartItem item = i.next();
String orderItemSeqId = item.getOrderItemSeqId();
if (orderItemSeqId != null) {
adjs = orderAdjsMap.get(orderItemSeqId);
} else {
adjs = null;
}
if (adjs != null) {
for (GenericValue adj : adjs) {
if (isTaxAdjustment( adj )) {
CartShipItemInfo csii = shipInfo.getShipItemInfo(item);
if (csii.itemTaxAdj == null) shipInfo.setItemInfo(item, UtilMisc.toList(adj));
else csii.itemTaxAdj.add(adj);
}
else item.addAdjustment(adj);
}
}