Package org.broadleafcommerce.core.order.domain

Examples of org.broadleafcommerce.core.order.domain.OrderItemAttribute


                orderItemAttributes = new HashMap<String, OrderItemAttribute>();
                item.setOrderItemAttributes(orderItemAttributes);
            }
            for (String key : attributes.keySet()) {
                String value = attributes.get(key);
                OrderItemAttribute attribute = new OrderItemAttributeImpl();
                attribute.setName(key);
                attribute.setValue(value);
                attribute.setOrderItem(item);
                orderItemAttributes.put(key, attribute);
            }
        }
    }
View Full Code Here


        }
       
        boolean changeMade = false;
        for (String attributeName : attributeValues.keySet()) {
            String attributeValue = attributeValues.get(attributeName);
            OrderItemAttribute attribute = orderItemAttributes.get(attributeName);
            if (attribute != null && attribute.getValue().equals(attributeValue)) {
                // no change made.
                continue;
            } else {
                changeMade = true;
                if (attribute == null) {
                    attribute = new OrderItemAttributeImpl();
                    attribute.setOrderItem(itemFromOrder);
                    attribute.setName(attributeName);
                    attribute.setValue(attributeValue);
                } else if (attributeValue == null) {
                    orderItemAttributes.remove(attributeValue);
                } else {
                    attribute.setValue(attributeValue);
                }
            }
        }

        if (changeMade) {
View Full Code Here

        }

        if (sku.getProductOptionValues() != null) {
            for (ProductOptionValue optionValue : sku.getProductOptionValues()) {
                String key = optionValue.getProductOption().getAttributeName();
                OrderItemAttribute attr = orderItem.getOrderItemAttributes().get(key);
                if (attr != null) {
                    attr.setValue(optionValue.getAttributeValue());
                } else {
                    OrderItemAttribute attribute = new OrderItemAttributeImpl();
                    attribute.setName(key);
                    attribute.setValue(optionValue.getAttributeValue());
                    attribute.setOrderItem(orderItem);
                    orderItem.getOrderItemAttributes().put(key, attribute);
                }
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.broadleafcommerce.core.order.domain.OrderItemAttribute

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.