Package org.broadleafcommerce.core.order.domain

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


    public OrderItemQualifier createOrderItemQualifier() {
        return new OrderItemQualifierImpl();
    }

    public OrderItemPriceDetail initializeOrderItemPriceDetails(OrderItem item) {
        OrderItemPriceDetail detail = createOrderItemPriceDetail();
        detail.setOrderItem(item);
        detail.setQuantity(item.getQuantity());
        detail.setUseSalePrice(item.getIsOnSale());
        item.getOrderItemPriceDetails().add(detail);
        return detail;
    }
View Full Code Here


        orderItem1.setQuantity(2);
        orderItem1.setSku(sku1);
        orderItem1.setId(getOrderItemId());
        orderItem1.setOrder(order);
       
        OrderItemPriceDetail priceDetail1 = new OrderItemPriceDetailImpl();
        priceDetail1.setOrderItem(orderItem1);
        priceDetail1.setQuantity(2);
        orderItem1.getOrderItemPriceDetails().add(priceDetail1);
       
        order.getOrderItems().add(orderItem1);
       
        DiscreteOrderItem orderItem2 = new DiscreteOrderItemImpl();
        orderItem2.setCategory(category2);
        orderItem2.setName("test2");
        orderItem2.setOrder(order);
        orderItem2.setOrderItemType(OrderItemType.DISCRETE);
        orderItem2.setProduct(product2);
        orderItem2.setQuantity(3);
        orderItem2.setSku(sku2);
        orderItem2.setId(getOrderItemId());
        orderItem2.setOrder(order);
       
        OrderItemPriceDetail priceDetail2 = new OrderItemPriceDetailImpl();
        priceDetail2.setOrderItem(orderItem2);
        priceDetail2.setQuantity(3);
        orderItem2.getOrderItemPriceDetails().add(priceDetail2);
       
        order.getOrderItems().add(orderItem2);
       
        Customer customer = new CustomerImpl();
View Full Code Here

        bundleOrderItem.setId(getOrderItemId());
        bundleOrderItem.setOrder(order);
        bundleOrderItem.setRetailPrice(new Money(10D));
        bundleOrderItem.setProductBundle(pb);

        OrderItemPriceDetail priceDetail = new OrderItemPriceDetailImpl();
        priceDetail.setOrderItem(bundleOrderItem);
        priceDetail.setQuantity(2);
        bundleOrderItem.getOrderItemPriceDetails().add(priceDetail);

        order.getOrderItems().add(bundleOrderItem);

        DiscreteOrderItem orderItem1 = new DiscreteOrderItemImpl();
        orderItem1.setCategory(category1);
        orderItem1.setName("test1");
        orderItem1.setOrder(order);
        orderItem1.setOrderItemType(OrderItemType.DISCRETE);
        orderItem1.setProduct(product1);
        orderItem1.setQuantity(2);
        orderItem1.setSku(sku1);
        orderItem1.setId(getOrderItemId());
        orderItem1.setOrder(order);

        OrderItemPriceDetail priceDetail1 = new OrderItemPriceDetailImpl();
        priceDetail1.setOrderItem(orderItem1);
        priceDetail1.setQuantity(2);
        orderItem1.getOrderItemPriceDetails().add(priceDetail1);

        bundleOrderItem.getDiscreteOrderItems().add(orderItem1);

        DiscreteOrderItem orderItem2 = new DiscreteOrderItemImpl();
        orderItem2.setCategory(category2);
        orderItem2.setName("test2");
        orderItem2.setOrder(order);
        orderItem2.setOrderItemType(OrderItemType.DISCRETE);
        orderItem2.setProduct(product2);
        orderItem2.setQuantity(3);
        orderItem2.setSku(sku2);
        orderItem2.setId(getOrderItemId());
        orderItem2.setOrder(order);

        OrderItemPriceDetail priceDetail2 = new OrderItemPriceDetailImpl();
        priceDetail2.setOrderItem(orderItem2);
        priceDetail2.setQuantity(3);
        orderItem2.getOrderItemPriceDetails().add(priceDetail2);

        bundleOrderItem.getDiscreteOrderItems().add(orderItem2);

        Customer customer = new CustomerImpl();
View Full Code Here

                "([MVEL.eval(\"toUpperCase()\",\"test1\"), MVEL.eval(\"toUpperCase()\",\"test2\")] contains MVEL.eval(\"toUpperCase()\", discreteOrderItem.category.name))"
                ).get(0);
        candidateOffer = new PromotableCandidateItemOfferImpl(promotableOrder, offer);
       
        promotableOrderItem = new PromotableOrderItemImpl(orderItem1, null, new PromotableItemFactoryImpl(), false);
        OrderItemPriceDetail pdetail = new OrderItemPriceDetailImpl();
        pdetail.setOrderItem(orderItem1);
        pdetail.setQuantity(2);
        priceDetail = new PromotableOrderItemPriceDetailImpl(promotableOrderItem, 2);
       
        List<PromotableOrderItem> items = new ArrayList<PromotableOrderItem>();
        items.add(promotableOrderItem);
       
View Full Code Here

        Iterator<OrderItemPriceDetail> unmatchedDetailsIterator = unmatchedDetailsMap.values().iterator();

        for (PromotableOrderItemPriceDetail priceDetail : promotableDetailsMap.values()) {
            if (unmatchedDetailsIterator.hasNext()) {
                // Reuse an existing priceDetail
                OrderItemPriceDetail existingDetail = unmatchedDetailsIterator.next();

                // Reset use Sale flag to true
                existingDetail.setUseSalePrice(true);

                offerServiceUtilities.updatePriceDetail(existingDetail, priceDetail);
                unmatchedDetailsIterator.remove();
            } else {
                // Create a new priceDetail
                OrderItemPriceDetail newPriceDetail = orderItemDao.createOrderItemPriceDetail();
                newPriceDetail.setOrderItem(orderItem);
                offerServiceUtilities.updatePriceDetail(newPriceDetail, priceDetail);
                orderItem.getOrderItemPriceDetails().add(newPriceDetail);
            }
        }
View Full Code Here

    @Override
    public void removeUnmatchedPriceDetails(Map<Long, ? extends OrderItemPriceDetail> unmatchedDetailsMap,
            Iterator<? extends OrderItemPriceDetail> pdIterator) {
        while (pdIterator.hasNext()) {
            OrderItemPriceDetail currentDetail = pdIterator.next();
            if (unmatchedDetailsMap.containsKey(currentDetail.getId())) {
                pdIterator.remove();
            }
        }
    }
View Full Code Here

TOP

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

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.