Class ResetDeliveryMethodOnAddToCartMethodHook

  • All Implemented Interfaces:
    de.hybris.platform.commerceservices.order.hook.CommerceAddToCartMethodHook

    public class ResetDeliveryMethodOnAddToCartMethodHook
    extends java.lang.Object
    implements de.hybris.platform.commerceservices.order.hook.CommerceAddToCartMethodHook
    Resets delivery mode to null every time on adding a new product to the cart to avoid keeping inappropriate delivery mode for the new items.
    • Constructor Detail

      • ResetDeliveryMethodOnAddToCartMethodHook

        public ResetDeliveryMethodOnAddToCartMethodHook()
    • Method Detail

      • beforeAddToCart

        public void beforeAddToCart​(CommerceCartParameter paramCommerceCartParameter)
                             throws de.hybris.platform.commerceservices.order.CommerceCartModificationException
        Specified by:
        beforeAddToCart in interface de.hybris.platform.commerceservices.order.hook.CommerceAddToCartMethodHook
        Throws:
        de.hybris.platform.commerceservices.order.CommerceCartModificationException
      • afterAddToCart

        public void afterAddToCart​(CommerceCartParameter paramCommerceCartParameter,
                                   CommerceCartModification paramCommerceCartModification)
                            throws de.hybris.platform.commerceservices.order.CommerceCartModificationException
        Specified by:
        afterAddToCart in interface de.hybris.platform.commerceservices.order.hook.CommerceAddToCartMethodHook
        Throws:
        de.hybris.platform.commerceservices.order.CommerceCartModificationException
      • getCartService

        protected de.hybris.platform.order.CartService getCartService()
        Returns:
        the cartService
      • setCartService

        public void setCartService​(de.hybris.platform.order.CartService cartService)
        Parameters:
        cartService - the cartService to set