org.broadleafcommerce.core.offer.service
Interface OrderItemMergeService

All Known Implementing Classes:
OrderItemMergeServiceImpl

public interface OrderItemMergeService

Author:
Jeff Fischer

Method Summary
 String buildIdentifier(OrderItem orderItem, String extraIdentifier)
          Returns a key that determines whether or not two items can be merged together.
 void finalizeCart(PromotableOrder order)
           
 void gatherCart(PromotableOrder promotableOrder)
           
 void gatherSplitItemsInBundles(Order order)
           
 FulfillmentGroupItemDao getFulfillmentGroupItemDao()
           
 FulfillmentGroupService getFulfillmentGroupService()
           
 OrderItemService getOrderItemService()
           
 OrderMultishipOptionService getOrderMultishipOptionService()
           
 OrderService getOrderService()
           
 PromotableItemFactory getPromotableItemFactory()
           
 void initializeBundleSplitItems(PromotableOrder order)
           
 void initializeSplitItems(PromotableOrder order)
           
 void mergeSplitItems(PromotableOrder order)
           
 void prepareCart(PromotableOrder promotableOrder)
           
 void setFulfillmentGroupItemDao(FulfillmentGroupItemDao fulfillmentGroupItemDao)
           
 void setFulfillmentGroupService(FulfillmentGroupService fulfillmentGroupService)
           
 void setOrderItemService(OrderItemService orderItemService)
           
 void setOrderMultishipOptionService(OrderMultishipOptionService orderMultishipOptionService)
           
 void setOrderService(OrderService orderService)
           
 void setPromotableItemFactory(PromotableItemFactory promotableItemFactory)
           
 

Method Detail

gatherSplitItemsInBundles

void gatherSplitItemsInBundles(Order order)
                               throws PricingException
Throws:
PricingException

mergeSplitItems

void mergeSplitItems(PromotableOrder order)

finalizeCart

void finalizeCart(PromotableOrder order)
                  throws PricingException
Throws:
PricingException

prepareCart

void prepareCart(PromotableOrder promotableOrder)

gatherCart

void gatherCart(PromotableOrder promotableOrder)

initializeBundleSplitItems

void initializeBundleSplitItems(PromotableOrder order)

initializeSplitItems

void initializeSplitItems(PromotableOrder order)

buildIdentifier

String buildIdentifier(OrderItem orderItem,
                       String extraIdentifier)
Returns a key that determines whether or not two items can be merged together. If the keys match, the system will merge the items. Uses the CartService.automaticallyMergeLikeItems to determine if the key should include non-promotion related merging. This process complements the merging and splitting required for the system. To fully understand this flag, you need to understand the reason that the system splits items. In the cart, an item can only have one price. Consider the example, where you have a cart-item with a quantity of two and a buy-one get one free promotion. After the promotion is applied, you would have two items in the cart: one at the regular price, and one free. Now, assume the promotion is removed. The system will automatically merge the two items back together. This method generates an "identifier" (or key) that determines whether two items can be merged. The expected behavior allows users to amend the merging requirements for promotions and choose to always merge like items by setting the CartService.automaticallyMergeLikeItems to true. If merging is too aggressive for your implementation, you might choose to override this method to add more specific rules for merging like items. The key is that the system will merge items that return the same String identifier. The out of box implementation insures the following: - Items in a bundle do not get merged outside of the bundle - Items do not get merged with items in a separate fulfillment group - If the CartService.automaticallyMergeLikeItems is false, only items that were previously split by the promotion engine will be merged; otherwise, the system will try to merge all like items.

Parameters:
orderItem -
extraIdentifier -
Returns:

getFulfillmentGroupItemDao

FulfillmentGroupItemDao getFulfillmentGroupItemDao()

setFulfillmentGroupItemDao

void setFulfillmentGroupItemDao(FulfillmentGroupItemDao fulfillmentGroupItemDao)

getFulfillmentGroupService

FulfillmentGroupService getFulfillmentGroupService()

setFulfillmentGroupService

void setFulfillmentGroupService(FulfillmentGroupService fulfillmentGroupService)

getOrderItemService

OrderItemService getOrderItemService()

setOrderItemService

void setOrderItemService(OrderItemService orderItemService)

getOrderMultishipOptionService

OrderMultishipOptionService getOrderMultishipOptionService()

setOrderMultishipOptionService

void setOrderMultishipOptionService(OrderMultishipOptionService orderMultishipOptionService)

getOrderService

OrderService getOrderService()

setOrderService

void setOrderService(OrderService orderService)

getPromotableItemFactory

PromotableItemFactory getPromotableItemFactory()

setPromotableItemFactory

void setPromotableItemFactory(PromotableItemFactory promotableItemFactory)


Copyright © 2013. All Rights Reserved.