/**
*
*/
public CustomerWishlistViewBean buildViewBeanCustomerWishlist(final RequestData requestData, final Customer customer) throws Exception {
final MarketArea marketArea = requestData.getMarketArea();
final CustomerWishlistViewBean customerWishlistViewBean = new CustomerWishlistViewBean();
final CustomerMarketArea customerMarketArea = customer.getCurrentCustomerMarketArea(marketArea.getId());
if (customerMarketArea != null) {
final Set<CustomerWishlist> customerWishlists = customerMarketArea.getWishlistProducts();
if (Hibernate.isInitialized(customerWishlists) && customerWishlists != null) {
for (Iterator<CustomerWishlist> iterator = customerWishlists.iterator(); iterator.hasNext();) {
final CustomerWishlist customerWishlist = (CustomerWishlist) iterator.next();
final ProductSku productSku = productService.getProductSkuByCode(customerWishlist.getProductSkuCode());
final ProductMarketing productMarketing = productService.getProductMarketingByCode(productSku.getProductMarketing().getCode());
final CatalogCategoryVirtual catalogCategory = catalogCategoryService.getDefaultVirtualCatalogCategoryByProductSkuId(productSku.getId());
customerWishlistViewBean.getProductSkus().add(buildViewBeanProductSku(requestData, catalogCategory, productMarketing, productSku));
}
}
}
return customerWishlistViewBean;
}