Class TmaPoAddToCartMethodHook
- java.lang.Object
-
- de.hybris.platform.b2ctelcoservices.hook.impl.TmaPoAddToCartMethodHook
-
- All Implemented Interfaces:
de.hybris.platform.commerceservices.order.hook.CommerceAddToCartMethodHook
public class TmaPoAddToCartMethodHook extends java.lang.Object implements de.hybris.platform.commerceservices.order.hook.CommerceAddToCartMethodHookTmaProductOfferingModelspecific add to cart operations.- Since:
- 6.7
-
-
Constructor Summary
Constructors Constructor Description TmaPoAddToCartMethodHook()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterAddToCart(CommerceCartParameter parameter, CommerceCartModification result)Assigns the cart entry group to the new added cart entry.The cart entries group is created based on the bundle product offering containing the new added offer.voidbeforeAddToCart(CommerceCartParameter parameters)Perform validation operations for cart entries containingTmaProductOfferingModel.protected de.hybris.platform.subscriptionservices.subscription.BillingTimeServicegetBillingTimeService()protected de.hybris.platform.order.CartServicegetCartService()protected de.hybris.platform.commerceservices.order.CommerceCartCalculationStrategygetCommerceCartCalculationStrategy()protected TmaCommercePriceServicegetCommercePriceService()protected TmaCompatibilityPolicyEnginegetCompatibilityPolicyEngine()protected de.hybris.platform.order.EntryGroupServicegetEntryGroupService()protected de.hybris.platform.enumeration.EnumerationServicegetEnumerationService()protected de.hybris.platform.servicelayer.model.ModelServicegetModelService()protected de.hybris.platform.subscriptionservices.subscription.SubscriptionCommerceCartServicegetSubscriptionCommerceCartService()protected TmaCartHookHelpergetTmaCartHookHelper()protected TmaPoServicegetTmaPoService()protected voidinvalidateBpoEntries(CartModel cart, int entryGroupNumber)Marks all cart entries that belong to the same bpo as "not calculated", as the prices within a bpo may vary depending on the product offerings bought as part of the same bpo and a re-calculation of the whole bpo entries (and all carts that contain entries of the affected bundle) is necessary.voidsetBillingTimeService(de.hybris.platform.subscriptionservices.subscription.BillingTimeService billingTimeService)voidsetCartService(de.hybris.platform.order.CartService cartService)voidsetCommerceCartCalculationStrategy(de.hybris.platform.commerceservices.order.CommerceCartCalculationStrategy commerceCartCalculationStrategy)voidsetCommercePriceService(TmaCommercePriceService commercePriceService)voidsetCompatibilityPolicyEngine(TmaCompatibilityPolicyEngine compatibilityPolicyEngine)voidsetDefaultProcessType(java.lang.String defaultProcessType)voidsetEntryGroupService(de.hybris.platform.order.EntryGroupService entryGroupService)voidsetEnumerationService(de.hybris.platform.enumeration.EnumerationService enumerationService)voidsetModelService(de.hybris.platform.servicelayer.model.ModelService modelService)voidsetSubscriptionCommerceCartService(de.hybris.platform.subscriptionservices.subscription.SubscriptionCommerceCartService subscriptionCommerceCartService)voidsetTmaCartHookHelper(TmaCartHookHelper tmaCartHookHelper)voidsetTmaPoService(TmaPoService tmaPoService)
-
-
-
Method Detail
-
beforeAddToCart
public void beforeAddToCart(CommerceCartParameter parameters) throws de.hybris.platform.commerceservices.order.CommerceCartModificationException
Perform validation operations for cart entries containingTmaProductOfferingModel.- Specified by:
beforeAddToCartin interfacede.hybris.platform.commerceservices.order.hook.CommerceAddToCartMethodHook- Parameters:
parameters- A parameter object - new cart entry details- Throws:
de.hybris.platform.commerceservices.order.CommerceCartModificationException- in case the parent is not valid
-
afterAddToCart
public void afterAddToCart(CommerceCartParameter parameter, CommerceCartModification result)
Assigns the cart entry group to the new added cart entry.The cart entries group is created based on the bundle product offering containing the new added offer. In case the cart entry has specified the cart entry group number, then the group is retrieved from the cart, otherwise a new group is created.- Specified by:
afterAddToCartin interfacede.hybris.platform.commerceservices.order.hook.CommerceAddToCartMethodHook- Parameters:
parameter- details for the new cart entry, before to be added to cartresult- details for the new cart entry, after it was added to cart
-
invalidateBpoEntries
protected void invalidateBpoEntries(@Nonnull CartModel cart, int entryGroupNumber)Marks all cart entries that belong to the same bpo as "not calculated", as the prices within a bpo may vary depending on the product offerings bought as part of the same bpo and a re-calculation of the whole bpo entries (and all carts that contain entries of the affected bundle) is necessary.- Parameters:
cart- the cart to recalculate entries in.entryGroupNumber- entry group number to retrieve the entries which need to be recalculated
-
getEntryGroupService
protected de.hybris.platform.order.EntryGroupService getEntryGroupService()
-
getTmaPoService
protected TmaPoService getTmaPoService()
-
getModelService
protected de.hybris.platform.servicelayer.model.ModelService getModelService()
-
getEnumerationService
protected de.hybris.platform.enumeration.EnumerationService getEnumerationService()
-
getCompatibilityPolicyEngine
protected TmaCompatibilityPolicyEngine getCompatibilityPolicyEngine()
-
getBillingTimeService
protected de.hybris.platform.subscriptionservices.subscription.BillingTimeService getBillingTimeService()
-
getSubscriptionCommerceCartService
protected de.hybris.platform.subscriptionservices.subscription.SubscriptionCommerceCartService getSubscriptionCommerceCartService()
-
getCartService
protected de.hybris.platform.order.CartService getCartService()
-
getCommerceCartCalculationStrategy
protected de.hybris.platform.commerceservices.order.CommerceCartCalculationStrategy getCommerceCartCalculationStrategy()
-
getTmaCartHookHelper
protected TmaCartHookHelper getTmaCartHookHelper()
-
getCommercePriceService
protected TmaCommercePriceService getCommercePriceService()
-
setEntryGroupService
public void setEntryGroupService(de.hybris.platform.order.EntryGroupService entryGroupService)
-
setTmaPoService
public void setTmaPoService(TmaPoService tmaPoService)
-
setModelService
public void setModelService(de.hybris.platform.servicelayer.model.ModelService modelService)
-
setEnumerationService
public void setEnumerationService(de.hybris.platform.enumeration.EnumerationService enumerationService)
-
setCompatibilityPolicyEngine
public void setCompatibilityPolicyEngine(TmaCompatibilityPolicyEngine compatibilityPolicyEngine)
-
setCartService
public void setCartService(de.hybris.platform.order.CartService cartService)
-
setCommerceCartCalculationStrategy
public void setCommerceCartCalculationStrategy(de.hybris.platform.commerceservices.order.CommerceCartCalculationStrategy commerceCartCalculationStrategy)
-
setTmaCartHookHelper
public void setTmaCartHookHelper(TmaCartHookHelper tmaCartHookHelper)
-
setDefaultProcessType
public void setDefaultProcessType(java.lang.String defaultProcessType)
-
setCommercePriceService
public void setCommercePriceService(TmaCommercePriceService commercePriceService)
-
setBillingTimeService
public void setBillingTimeService(de.hybris.platform.subscriptionservices.subscription.BillingTimeService billingTimeService)
-
setSubscriptionCommerceCartService
public void setSubscriptionCommerceCartService(de.hybris.platform.subscriptionservices.subscription.SubscriptionCommerceCartService subscriptionCommerceCartService)
-
-