use of org.broadleafcommerce.core.order.domain.PersonalMessage in project BroadleafCommerce by BroadleafCommerce.
the class LegacyOrderServiceImpl method createDiscreteOrderItemRequest.
protected DiscreteOrderItemRequest createDiscreteOrderItemRequest(DiscreteOrderItem discreteOrderItem) {
DiscreteOrderItemRequest itemRequest = new DiscreteOrderItemRequest();
itemRequest.setCategory(discreteOrderItem.getCategory());
itemRequest.setProduct(discreteOrderItem.getProduct());
itemRequest.setQuantity(discreteOrderItem.getQuantity());
itemRequest.setSku(discreteOrderItem.getSku());
if (discreteOrderItem.getPersonalMessage() != null) {
PersonalMessage personalMessage = orderItemService.createPersonalMessage();
try {
BeanUtils.copyProperties(personalMessage, discreteOrderItem.getPersonalMessage());
personalMessage.setId(null);
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
} catch (InvocationTargetException e) {
throw new RuntimeException(e);
}
itemRequest.setPersonalMessage(personalMessage);
}
return itemRequest;
}
Aggregations