for(OrderItem orderItem: currentCart.getOrderItems()){
//Lookup price in price list, if null, then add to itemsToRemove
if (orderItem instanceof DiscreteOrderItem){
DiscreteOrderItem doi = (DiscreteOrderItem) orderItem;
if(checkAvailabilityInLocale(doi, currency)){
AddToCartItem itemRequest = new AddToCartItem();
itemRequest.setProductId(doi.getProduct().getId());
itemRequest.setQuantity(doi.getQuantity());
itemsToReprice.add(itemRequest);
itemsToReset.add(orderItem);
} else {
itemsToRemove.add(orderItem);
}
} else if (orderItem instanceof BundleOrderItem) {
BundleOrderItem boi = (BundleOrderItem) orderItem;
for (DiscreteOrderItem doi : boi.getDiscreteOrderItems()) {
if(checkAvailabilityInLocale(doi, currency)){
AddToCartItem itemRequest = new AddToCartItem();
itemRequest.setProductId(doi.getProduct().getId());
itemRequest.setQuantity(doi.getQuantity());
itemsToReprice.add(itemRequest);
itemsToReset.add(orderItem);
} else {
itemsToRemove.add(orderItem);
}