for (ItemAttributeDetail itemAttributeDetail : item.getItemAttributeDetails()) {
CustomAttribute customAttribute = itemAttributeDetail.getCustomAttributeDetail().getCustomAttribute();
if (customAttribute.getCustomAttribTypeCode() != Constants.CUSTOM_ATTRIBUTE_TYPE_SKU_MAKEUP) {
continue;
}
OrderItemAttributeBean orderItemAttributeBean = new OrderItemAttributeBean();
orderItemAttributeBean.setCustomAttribDesc(customAttribute.getCustomAttributeLanguage().getCustomAttribDesc());
if (!contentBean.getContentSessionKey().isSiteProfileClassDefault()) {
for (CustomAttributeLanguage language : customAttribute.getCustomAttributeLanguages()) {
if (language.getSiteProfileClass().getSiteProfileClassId().equals(contentBean.getContentSessionKey().getSiteProfileClassId())) {
if (language.getCustomAttribDesc() != null) {
orderItemAttributeBean.setCustomAttribDesc(language.getCustomAttribDesc());
}
break;
}
}
}
CustomAttributeOption customAttributeOption = itemAttributeDetail.getCustomAttributeOption();
orderItemAttributeBean.setCustomAttribValue(customAttributeOption.getCustomAttributeOptionLanguage().getCustomAttribValue());
if (!contentBean.getContentSessionKey().isSiteProfileClassDefault()) {
for (CustomAttributeOptionLanguage language : customAttributeOption.getCustomAttributeOptionLanguages()) {
if (language.getSiteProfileClass().getSiteProfileClassId().equals(contentBean.getContentSessionKey().getSiteProfileClassId())) {
if (language.getCustomAttribValue() != null) {
orderItemAttributeBean.setCustomAttribValue(language.getCustomAttribValue());
}
break;
}
}
}
orderItemAttributes.add(orderItemAttributeBean);
}
}
for (OrderAttributeDetail orderAttributeDetail : detail.getOrderAttributeDetails()) {
OrderItemAttributeBean orderItemAttributeBean = new OrderItemAttributeBean();
CustomAttribute customAttribute = orderAttributeDetail.getCustomAttributeDetail().getCustomAttribute();
orderItemAttributeBean.setCustomAttribDesc(customAttribute.getCustomAttributeLanguage().getCustomAttribDesc());
if (!contentBean.getContentSessionKey().isSiteProfileClassDefault()) {
for (CustomAttributeLanguage language : customAttribute.getCustomAttributeLanguages()) {
if (language.getSiteProfileClass().getSiteProfileClassId().equals(contentBean.getContentSessionKey().getSiteProfileClassId())) {
if (language.getCustomAttribDesc() != null) {
orderItemAttributeBean.setCustomAttribDesc(language.getCustomAttribDesc());
}
break;
}
}
}
if (customAttribute.getCustomAttribTypeCode() == Constants.CUSTOM_ATTRIBUTE_TYPE_CUST_INPUT) {
orderItemAttributeBean.setCustomAttribValue(orderAttributeDetail.getOrderAttribValue());
}
else {
CustomAttributeOption customAttributeOption = orderAttributeDetail.getCustomAttributeOption();
orderItemAttributeBean.setCustomAttribValue(customAttributeOption.getCustomAttributeOptionLanguage().getCustomAttribValue());
if (!contentBean.getContentSessionKey().isSiteProfileClassDefault()) {
for (CustomAttributeOptionLanguage language : customAttributeOption.getCustomAttributeOptionLanguages()) {
if (language.getSiteProfileClass().getSiteProfileClassId().equals(contentBean.getContentSessionKey().getSiteProfileClassId())) {
if (language.getCustomAttribValue() != null) {
orderItemAttributeBean.setCustomAttribValue(language.getCustomAttribValue());
}
break;
}
}
}