if (!cartItem.getIsPromo() && (productIds.contains(cartItem.getProductId()) || (parentProductId != null && productIds.contains(parentProductId))) &&
(product == null || !"N".equals(product.getString("includeInPromotions")))) {
double quantityUsed = cartItem.addPromoQuantityCandidateUse(quantityDesired, productPromoAction, false);
if (quantityUsed > 0) {
quantityDesired -= quantityUsed;
<BUG>totalAmount += quantityUsed * cartItem.getBasePrice();
</BUG>
cartItemsUsed.add(cartItem);
}
}

if (!cartItem.getIsPromo() && (productIds.contains(cartItem.getProductId()) || (parentProductId != null && productIds.contains(parentProductId))) &&
(product == null || !"N".equals(product.getString("includeInPromotions")))) {
double quantityUsed = cartItem.addPromoQuantityCandidateUse(quantityDesired, productPromoAction, false);
if (quantityUsed > 0) {
quantityDesired -= quantityUsed;
totalAmount += quantityUsed * cartItem.getBasePrice() * cartItem.getRentalAdjustment();
cartItemsUsed.add(cartItem);
