Class SubscriptionUpdateCartEntryHook
- java.lang.Object
-
- de.hybris.platform.subscriptionservices.order.hook.SubscriptionUpdateCartEntryHook
-
- All Implemented Interfaces:
CommerceUpdateCartEntryHook
public class SubscriptionUpdateCartEntryHook extends java.lang.Object implements CommerceUpdateCartEntryHook
Handles subscription product quantity change.
-
-
Constructor Summary
Constructors Constructor Description SubscriptionUpdateCartEntryHook()
-
Method Summary
-
-
-
Method Detail
-
beforeUpdateCartEntry
public void beforeUpdateCartEntry(CommerceCartParameter parameter)
Description copied from interface:CommerceUpdateCartEntryHookExecuted before commerce update cart entry- Specified by:
beforeUpdateCartEntryin interfaceCommerceUpdateCartEntryHook
-
afterUpdateCartEntry
public void afterUpdateCartEntry(CommerceCartParameter parameter, CommerceCartModification result)
Description copied from interface:CommerceUpdateCartEntryHookExecuted after commerce update cart entry- Specified by:
afterUpdateCartEntryin interfaceCommerceUpdateCartEntryHook
-
normalizeEntriesInChildCarts
protected void normalizeEntriesInChildCarts(CartModel cart)
-
getEntry
protected AbstractOrderEntryModel getEntry(@Nonnull CartModel cart, long entryNumber)
-
removeEmptyChildCarts
protected void removeEmptyChildCarts(@Nonnull CartModel cartModel)
-
removeOrphanChildEntries
protected void removeOrphanChildEntries(@Nonnull CartModel cartModel)afterUpdateCartEntry(CommerceCartParameter, CommerceCartModification)gets a fake entry, because the original one is already removed at that moment.So the fake instance does not have any child entries. Here we search within the child carts what entries have got lost its
AbstractOrderEntryModel.getMasterEntry(). That would mean the master entry has been removed, and the child entry should be removed as well.WARNING Be careful optimizing the refresh calls - the system is very sensitive to it.
- Parameters:
cartModel- master cart
-
isMasterCart
protected boolean isMasterCart(CartModel cartModel)
-
getSubscriptionProductService
protected SubscriptionProductService getSubscriptionProductService()
-
setSubscriptionProductService
public void setSubscriptionProductService(SubscriptionProductService subscriptionProductService)
-
getModelService
protected ModelService getModelService()
-
setModelService
public void setModelService(ModelService modelService)
-
getCalculationStrategy
protected CommerceCartCalculationStrategy getCalculationStrategy()
-
setCalculationStrategy
public void setCalculationStrategy(CommerceCartCalculationStrategy calculationStrategy)
-
getSubscriptionCommerceCartStrategy
protected SubscriptionCommerceCartStrategy getSubscriptionCommerceCartStrategy()
-
setSubscriptionCommerceCartStrategy
public void setSubscriptionCommerceCartStrategy(SubscriptionCommerceCartStrategy subscriptionCommerceCartStrategy)
-
-