/**
*
*/
public HeaderCartViewBean buildViewBeanHeaderCart(final RequestData requestData) throws Exception {
final Locale locale = requestData.getLocale();
final HeaderCartViewBean headerCartViewBean = new HeaderCartViewBean();
// NO CACHE FOR THIS PART
final Cart currentCart = requestData.getCart();
headerCartViewBean.setCheckoutShoppingCartUrl(urlService.generateUrl(FoUrls.CART_DETAILS, requestData));
if(currentCart != null && currentCart.getCartItems() != null){
headerCartViewBean.setCartTotalItems(currentCart.getCartItems().size());
if (currentCart.getCartItems().size() == 1) {
headerCartViewBean.setCheckoutShoppingCartHeaderLabel(getSpecificMessage(ScopeWebMessage.COMMON, "cart_total_summary_label_one_item", locale));
} else if (currentCart.getCartItems().size() > 1) {
Object[] cartTotalSummaryLabelParams = { currentCart.getCartItems().size() };
headerCartViewBean.setCheckoutShoppingCartHeaderLabel(getSpecificMessage(ScopeWebMessage.COMMON, "cart_total_summary_label_many_items", cartTotalSummaryLabelParams, locale));
} else {
headerCartViewBean.setCheckoutShoppingCartHeaderLabel(getSpecificMessage(ScopeWebMessage.COMMON, "cart_total_summary_label_no_item", locale));
}
} else {
headerCartViewBean.setCartTotalItems(0);
headerCartViewBean.setCheckoutShoppingCartHeaderLabel(getSpecificMessage(ScopeWebMessage.COMMON, "cart_total_summary_label_no_item", locale));
}
return headerCartViewBean;
}