Class DefaultMultiAddressDeliveryCostsStrategy
java.lang.Object
de.hybris.platform.basecommerce.jalo.DefaultMultiAddressDeliveryCostsStrategy
- All Implemented Interfaces:
DeliveryCostsStrategy
public class DefaultMultiAddressDeliveryCostsStrategy
extends Object
implements DeliveryCostsStrategy
Calculates the delivery costs of the specified
AbstractOrder by grouping its AbstractOrderEntry based
on their assigned DeliveryMode and 'DeliveryAddress'. For each of these "groups" a new order
createTempCart(java.util.List<de.hybris.platform.jalo.order.AbstractOrderEntry>, de.hybris.platform.jalo.user.Address, de.hybris.platform.jalo.order.delivery.DeliveryMode, de.hybris.platform.jalo.user.User, de.hybris.platform.jalo.c2l.Currency, boolean) and the total of their delivery costs will be
returned by getCost(de.hybris.platform.jalo.SessionContext, de.hybris.platform.jalo.order.AbstractOrder).-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected AbstractOrdercreateTempCart(List<AbstractOrderEntry> entries, Address deliveryAddress, DeliveryMode mode, User user, Currency curr, boolean net) Creates a temporary order, which will be used for calculating the delivery costs of the assignedAbstractOrderEntry.findDeliveryCosts(SessionContext ctx, AbstractOrder order) Called duringAbstractOrder.calculate(),AbstractOrder.calculate(java.util.Date),AbstractOrder.recalculate()andAbstractOrder.recalculate(java.util.Date)to fetch and set the delivery cost for the assigned order.protected PriceValuegetCost(SessionContext ctx, AbstractOrder order) Calculates the delivery costs of the specifiedAbstractOrderby grouping itsAbstractOrderEntrybased on their assignedDeliveryModeand 'DeliveryAddress'.voidsetCartFactory(CartFactory cartFactory)
-
Constructor Details
-
DefaultMultiAddressDeliveryCostsStrategy
public DefaultMultiAddressDeliveryCostsStrategy()
-
-
Method Details
-
getCartFactory
-
setCartFactory
-
findDeliveryCosts
Called duringAbstractOrder.calculate(),AbstractOrder.calculate(java.util.Date),AbstractOrder.recalculate()andAbstractOrder.recalculate(java.util.Date)to fetch and set the delivery cost for the assigned order.- Specified by:
findDeliveryCostsin interfaceDeliveryCostsStrategy- Returns:
- the delivery costs of this abstract order
-
getCost
protected PriceValue getCost(SessionContext ctx, AbstractOrder order) throws JaloDeliveryModeException Calculates the delivery costs of the specifiedAbstractOrderby grouping itsAbstractOrderEntrybased on their assignedDeliveryModeand 'DeliveryAddress'. For each of these "groups" a new ordercreateTempCart(java.util.List<de.hybris.platform.jalo.order.AbstractOrderEntry>, de.hybris.platform.jalo.user.Address, de.hybris.platform.jalo.order.delivery.DeliveryMode, de.hybris.platform.jalo.user.User, de.hybris.platform.jalo.c2l.Currency, boolean)will be created and its delivery cost calculated.- Parameters:
ctx- the session contextorder- the original order (containingAbstractOrderEntry, which can have their own 'DeliveryAddress'- Returns:
- the sum of all delivery costs
- Throws:
JaloDeliveryModeException
-
createTempCart
protected AbstractOrder createTempCart(List<AbstractOrderEntry> entries, Address deliveryAddress, DeliveryMode mode, User user, Currency curr, boolean net) throws JaloGenericCreationException, JaloAbstractTypeException Creates a temporary order, which will be used for calculating the delivery costs of the assignedAbstractOrderEntry. The configuredCartFactorywill be used for the internal cart/order creation- Parameters:
entries- the order entries, which will be added to the returned orderdeliveryAddress- the delivery address of the ordermode- the DeliveryMode of the orderuser- the order usercurr- the currencynet- the pricing of the order- Returns:
- the 'new' order
- Throws:
JaloGenericCreationExceptionJaloAbstractTypeException
-