*/
public OrderItemViewBean buildViewBeanOrderItem(final RequestData requestData, final OrderItem orderItem) throws Exception {
final Localization localization = requestData.getMarketAreaLocalization();
final String localizationCode = localization.getCode();
final OrderItemViewBean orderItemViewBean = new OrderItemViewBean();
orderItemViewBean.setSkuCode(orderItem.getProductSkuCode());
if(StringUtils.isNotEmpty(orderItem.getProductSkuCode())){
ProductSku ProductSku = productService.getProductSkuByCode(orderItem.getProductSkuCode());
orderItemViewBean.setName(ProductSku.getI18nName(localizationCode));
}
final BigDecimal price = orderItem.getPrice();
if (price != null) {
orderItemViewBean.setPrice(orderItem.getCurrency().formatPriceWithStandardCurrencySign(price));
}
orderItemViewBean.setQuantity(orderItem.getQuantity());
final BigDecimal totalAmountOrderItem = orderItem.getTotalAmountOrderItem();
if (totalAmountOrderItem != null) {
orderItemViewBean.setAmount(orderItem.getCurrency().formatPriceWithStandardCurrencySign(totalAmountOrderItem));
}
return orderItemViewBean;
}