Package com.jada.order.cart

Examples of com.jada.order.cart.ItemAttributeInfo


            }
           
            Vector<ShoppingCartItemAttributeBean> shoppingCartItemAttributes = new Vector<ShoppingCartItemAttributeBean>();
            Iterator<?> itemAttributeInfoIterator = shoppingCartItem.getItemAttributeInfos().iterator();
            while (itemAttributeInfoIterator.hasNext()) {
              ItemAttributeInfo itemAttributeInfo = (ItemAttributeInfo) itemAttributeInfoIterator.next();
              ShoppingCartItemAttributeBean attributeBean = new ShoppingCartItemAttributeBean();
             
              ItemAttributeDetail itemAttributeDetail = (ItemAttributeDetail) em.find(ItemAttributeDetail.class, itemAttributeInfo.getItemAttribDetailId());
              CustomAttribute customAttribute = itemAttributeDetail.getCustomAttributeDetail().getCustomAttribute();
              if (customAttribute.getCustomAttribTypeCode() == Constants.CUSTOM_ATTRIBUTE_TYPE_USER_INPUT) {
                continue;
              }
              if (customAttribute.getCustomAttribTypeCode() == Constants.CUSTOM_ATTRIBUTE_TYPE_USER_SELECT_DROPDOWN) {
                continue;
              }
             
              attributeBean.setCustomAttribDesc(customAttribute.getCustomAttributeLanguage().getCustomAttribDesc());
              if (!contentBean.getContentSessionBean().isSiteProfileClassDefault()) {
                for (CustomAttributeLanguage language : customAttribute.getCustomAttributeLanguages()) {
                  if (language.getSiteProfileClass().getSiteProfileClassId().equals(siteProfileClassId)) {
                    if (language.getCustomAttribDesc() != null) {
                      attributeBean.setCustomAttribDesc(language.getCustomAttribDesc());
                    }
                      break;
                  }
                }
              }
             
              if (customAttribute.getCustomAttribTypeCode() == Constants.CUSTOM_ATTRIBUTE_TYPE_CUST_INPUT) {
                attributeBean.setCustomAttribValue(itemAttributeInfo.getItemAttribDetailValue());
              }
              else {
                CustomAttributeOption customAttribOption = CustomAttributeOptionDAO.load(site.getSiteId(), itemAttributeInfo.getCustomAttribOptionId());
                attributeBean.setCustomAttribValue(customAttribOption.getCustomAttributeOptionLanguage().getCustomAttribValue());
                if (!contentBean.getContentSessionBean().isSiteProfileClassDefault()) {
                  for (CustomAttributeOptionLanguage language : customAttribOption.getCustomAttributeOptionLanguages()) {
                    if (language.getSiteProfileClass().getSiteProfileClassId().equals(siteProfileClassId)) {
                      if (language.getCustomAttribValue() != null) {
View Full Code Here


      }
      orderItemDetail.setOrderHeader(orderHeader);
     
      Iterator<?> iterator = shoppingCartItem.getItemAttributeInfos().iterator();
      while (iterator.hasNext()) {
        ItemAttributeInfo itemAttributeInfo = (ItemAttributeInfo) iterator.next();
        ItemAttributeDetail itemAttributeDetail = (ItemAttributeDetail) em.find(ItemAttributeDetail.class, itemAttributeInfo.getItemAttribDetailId());
        char customAttribTypeCode = itemAttributeDetail.getCustomAttributeDetail().getCustomAttribute().getCustomAttribTypeCode();
        if (customAttribTypeCode == Constants.CUSTOM_ATTRIBUTE_TYPE_SKU_MAKEUP) {
          continue;
        }
        if (customAttribTypeCode == Constants.CUSTOM_ATTRIBUTE_TYPE_USER_INPUT) {
          continue;
        }
        if (customAttribTypeCode == Constants.CUSTOM_ATTRIBUTE_TYPE_USER_SELECT_DROPDOWN) {
          continue;
        }
        OrderAttributeDetail orderAttributeDetail = new OrderAttributeDetail();
        orderAttributeDetail.setOrderItemDetail(orderItemDetail);
        orderAttributeDetail.setCustomAttributeDetail(itemAttributeDetail.getCustomAttributeDetail());
        if (customAttribTypeCode == Constants.CUSTOM_ATTRIBUTE_TYPE_CUST_SELECT_DROPDOWN) {
          CustomAttributeOption customAttributeOption = (CustomAttributeOption) em.find(CustomAttributeOption.class, itemAttributeInfo.getCustomAttribOptionId());
          orderAttributeDetail.setCustomAttributeOption(customAttributeOption);
        }
        if (customAttribTypeCode == Constants.CUSTOM_ATTRIBUTE_TYPE_CUST_INPUT) {
          orderAttributeDetail.setOrderAttribValue(itemAttributeInfo.getItemAttribDetailValue());
        }
        orderItemDetail.getOrderAttributeDetails().add(orderAttributeDetail);
      }
     
      orderHeader.getOrderItemDetails().add(orderItemDetail);
View Full Code Here

      Vector<ItemAttributeInfo> itemAttributeInfos = new Vector<ItemAttributeInfo>();
      if (itemAttribDetailIds != null) {
        String customAttribValues[] = form.getCustomAttribValues();
        String customAttribTypeCodes[] = form.getCustomAttribTypeCodes();
        for (int i = 0; i < itemAttribDetailIds.length; i++) {
          ItemAttributeInfo itemAttributeInfo = new ItemAttributeInfo();
          itemAttributeInfo.setCustomAttribTypeCode(customAttribTypeCodes[i]);
          itemAttributeInfo.setItemAttribDetailId(Format.getLong(itemAttribDetailIds[i]));
          if (customAttribTypeCodes[i].equals(String.valueOf(Constants.CUSTOM_ATTRIBUTE_TYPE_CUST_INPUT))) {
            itemAttributeInfo.setItemAttribDetailValue(customAttribValues[i]);
          }
          else {
            itemAttributeInfo.setCustomAttribOptionId(Format.getLong(customAttribValues[i]));
          }
          itemAttributeInfos.add(itemAttributeInfo);
        }
      }
     
View Full Code Here

TOP

Related Classes of com.jada.order.cart.ItemAttributeInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.