Package org.broadleafcommerce.core.offer.domain

Examples of org.broadleafcommerce.core.offer.domain.OfferItemCriteria


        offer.setDiscountType(discountType);
        offer.setValue(BigDecimal.valueOf(value));
        offer.setDeliveryType(OfferDeliveryType.CODE);
        offer.setStackable(true);

        OfferItemCriteria oic = new OfferItemCriteriaImpl();
        oic.setQuantity(1);
        oic.setMatchRule(orderRule);
        offer.setTargetItemCriteria(Collections.singleton(oic));

        offer.setAppliesToCustomerRules(customerRule);
        offer.setCombinableWithOtherOffers(true);
        offer = offerService.save(offer);
View Full Code Here


        List<Offer> offers = createOrderBasedOffer(orderRule, discountType);
        offers.get(0).setType(OfferType.ORDER_ITEM);
       
        if (targetRule != null) {
            Set<OfferItemCriteria> targetSet = new HashSet<OfferItemCriteria>();
            OfferItemCriteria targetCriteria = new OfferItemCriteriaImpl();
            //targetCriteria.setQualifyingOffer(offers.get(0));
            targetCriteria.setQuantity(1);
            targetCriteria.setMatchRule(targetRule);
            targetSet.add(targetCriteria);
           
            offers.get(0).setTargetItemCriteria(targetSet);
        }
       
View Full Code Here

    }
   
    public List<Offer> createOrderBasedOfferWithItemCriteria(String orderRule, OfferDiscountType discountType, String orderItemMatchRule) {
        List<Offer> offers = createOrderBasedOffer(orderRule, discountType);
       
        OfferItemCriteria qualCriteria = new OfferItemCriteriaImpl();
        //qualCriteria.setQualifyingOffer(offers.get(0));
        qualCriteria.setQuantity(1);
        qualCriteria.setMatchRule(orderItemMatchRule);
        Set<OfferItemCriteria> criterias = new HashSet<OfferItemCriteria>();
        criterias.add(qualCriteria);
       
        offers.get(0).setQualifyingItemCriteria(criterias);
       
View Full Code Here

    }
   
    public List<Offer> createFGBasedOfferWithItemCriteria(String orderRule, String fgRule, OfferDiscountType discountType, String orderItemMatchRule) {
        List<Offer> offers = createFGBasedOffer(orderRule, fgRule, discountType);
       
        OfferItemCriteria qualCriteria = new OfferItemCriteriaImpl();
        //qualCriteria.setQualifyingOffer(offers.get(0));
        qualCriteria.setQuantity(1);
        qualCriteria.setMatchRule(orderItemMatchRule);
        Set<OfferItemCriteria> criterias = new HashSet<OfferItemCriteria>();
        criterias.add(qualCriteria);
       
        offers.get(0).setQualifyingItemCriteria(criterias);
       
View Full Code Here

   
    public List<Offer> createItemBasedOfferWithItemCriteria(String orderRule, OfferDiscountType discountType, String qualRule, String targetRule) {
        List<Offer> offers = createItemBasedOffer(orderRule, targetRule, discountType);
       
        if (qualRule != null) {
            OfferItemCriteria qualCriteria = new OfferItemCriteriaImpl();
            //qualCriteria.setQualifyingOffer(offers.get(0));
            qualCriteria.setQuantity(1);
            qualCriteria.setMatchRule(qualRule);
            Set<OfferItemCriteria> criterias = new HashSet<OfferItemCriteria>();
            criterias.add(qualCriteria);
           
            offers.get(0).setQualifyingItemCriteria(criterias);
        }
View Full Code Here

        if (stackable) {
            offer.setOfferItemQualifierRuleType(OfferItemRestrictionRuleType.QUALIFIER_TARGET);
            offer.setOfferItemTargetRuleType(OfferItemRestrictionRuleType.QUALIFIER_TARGET);
        }
       
        OfferItemCriteria oic = new OfferItemCriteriaImpl();
        oic.setQuantity(1);
        oic.setMatchRule(orderRule);
        offer.setTargetItemCriteria(Collections.singleton(oic));
       
        offer.setAppliesToCustomerRules(customerRule);
        offer.setCombinableWithOtherOffers(combinable);
        offer.setPriority(priority);
View Full Code Here

     */
    protected boolean markRelatedQualifiersAndTargets(PromotableCandidateItemOffer itemOffer, PromotableOrder order) {
        OrderItemHolder orderItemHolder = new OrderItemHolder(null);

        for (Entry<OfferItemCriteria, List<PromotableOrderItem>> entry : itemOffer.getCandidateQualifiersMap().entrySet()) {
            OfferItemCriteria itemCriteria = entry.getKey();
            List<PromotableOrderItem> promotableItems = entry.getValue();

            List<PromotableOrderItemPriceDetail> priceDetails = buildPriceDetailListFromOrderItems(promotableItems);
            int qualifierQtyNeeded = offerServiceUtilities.markRelatedQualifiersAndTargetsForItemCriteria(itemOffer, order,
                    orderItemHolder, itemCriteria, priceDetails, this);
View Full Code Here

            if (qualifierQtyNeeded > 0) {
                int itemQtyAvailableToBeUsedAsQualifier = detail.getQuantityAvailableToBeUsedAsQualifier(itemOffer);
                if (itemQtyAvailableToBeUsedAsQualifier > 0) {
                    // We have found a qualifier that meets this offer criteria. First, we'll save some state that we
                    // might need in the future.
                    OfferItemCriteria previousQualifierCriteria = null;
                    for (PromotionQualifier possibleQualifier : detail.getPromotionQualifiers()) {
                        if (possibleQualifier.getPromotion().equals(itemOffer.getOffer())) {
                            previousQualifierCriteria = possibleQualifier.getItemCriteria();
                            break;
                        }
View Full Code Here

TOP

Related Classes of org.broadleafcommerce.core.offer.domain.OfferItemCriteria

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.