Class SubscriptionUpdateCartEntryHook
java.lang.Object
de.hybris.platform.subscriptionservices.order.hook.SubscriptionUpdateCartEntryHook
- All Implemented Interfaces:
CommerceUpdateCartEntryHook
Handles subscription product quantity change.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafterUpdateCartEntry(CommerceCartParameter parameter, CommerceCartModification result) Executed after commerce update cart entryvoidbeforeUpdateCartEntry(CommerceCartParameter parameter) Executed before commerce update cart entryprotected CommerceCartCalculationStrategyprotected AbstractOrderEntryModelprotected ModelServiceprotected SubscriptionCommerceCartStrategyprotected SubscriptionProductServiceprotected booleanisMasterCart(CartModel cartModel) protected voidprotected voidremoveEmptyChildCarts(CartModel cartModel) protected voidremoveOrphanChildEntries(CartModel cartModel) afterUpdateCartEntry(CommerceCartParameter, CommerceCartModification)gets a fake entry, because the original one is already removed at that moment.voidsetCalculationStrategy(CommerceCartCalculationStrategy calculationStrategy) voidsetModelService(ModelService modelService) voidsetSubscriptionCommerceCartStrategy(SubscriptionCommerceCartStrategy subscriptionCommerceCartStrategy) voidsetSubscriptionProductService(SubscriptionProductService subscriptionProductService)
-
Constructor Details
-
SubscriptionUpdateCartEntryHook
public SubscriptionUpdateCartEntryHook()
-
-
Method Details
-
beforeUpdateCartEntry
Description copied from interface:CommerceUpdateCartEntryHookExecuted before commerce update cart entry- Specified by:
beforeUpdateCartEntryin interfaceCommerceUpdateCartEntryHook
-
afterUpdateCartEntry
Description copied from interface:CommerceUpdateCartEntryHookExecuted after commerce update cart entry- Specified by:
afterUpdateCartEntryin interfaceCommerceUpdateCartEntryHook
-
normalizeEntriesInChildCarts
-
getEntry
-
removeEmptyChildCarts
-
removeOrphanChildEntries
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
-
getSubscriptionProductService
-
setSubscriptionProductService
-
getModelService
-
setModelService
-
getCalculationStrategy
-
setCalculationStrategy
-
getSubscriptionCommerceCartStrategy
-
setSubscriptionCommerceCartStrategy
public void setSubscriptionCommerceCartStrategy(SubscriptionCommerceCartStrategy subscriptionCommerceCartStrategy)
-