Class 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.CommerceAddToCartMethodHook
    TmaProductOfferingModel specific add to cart operations.
    Since:
    6.7
    • Constructor Detail

      • TmaPoAddToCartMethodHook

        public TmaPoAddToCartMethodHook()
    • Method Detail

      • beforeAddToCart

        public void beforeAddToCart​(CommerceCartParameter parameters)
                             throws de.hybris.platform.commerceservices.order.CommerceCartModificationException
        Perform validation operations for cart entries containing TmaProductOfferingModel.
        Specified by:
        beforeAddToCart in interface de.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:
        afterAddToCart in interface de.hybris.platform.commerceservices.order.hook.CommerceAddToCartMethodHook
        Parameters:
        parameter - details for the new cart entry, before to be added to cart
        result - 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()
      • 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()
      • 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)
      • 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)
      • setBillingTimeService

        public void setBillingTimeService​(de.hybris.platform.subscriptionservices.subscription.BillingTimeService billingTimeService)
      • setSubscriptionCommerceCartService

        public void setSubscriptionCommerceCartService​(de.hybris.platform.subscriptionservices.subscription.SubscriptionCommerceCartService subscriptionCommerceCartService)