Class TmaCommerceAddToCartStrategy

  • All Implemented Interfaces:
    TmaCartStrategy, de.hybris.platform.commerceservices.order.CommerceAddToCartStrategy

    public class TmaCommerceAddToCartStrategy
    extends de.hybris.platform.commerceservices.order.impl.DefaultCommerceAddToCartStrategy
    implements TmaCartStrategy
    Overrides DefaultCommerceAddToCartStrategy to calculate the cart before triggering add to cart and also after merging the entry.
    Since:
    6.7
    • Method Detail

      • processCartAction

        public java.util.List<CommerceCartModification> processCartAction​(java.util.List<CommerceCartParameter> commerceCartParameterList)
                                                                   throws de.hybris.platform.commerceservices.order.CommerceCartModificationException
        Description copied from interface: TmaCartStrategy
        Processes cart updates.
        Specified by:
        processCartAction in interface TmaCartStrategy
        Parameters:
        commerceCartParameterList - contains attributes used for cart updates
        Returns:
        list CommerceCartModification
        Throws:
        de.hybris.platform.commerceservices.order.CommerceCartModificationException - in case of any error occurs during cart update
      • addToCart

        public CommerceCartModification addToCart​(CommerceCartParameter parameter)
                                           throws de.hybris.platform.commerceservices.order.CommerceCartModificationException
        Specified by:
        addToCart in interface de.hybris.platform.commerceservices.order.CommerceAddToCartStrategy
        Overrides:
        addToCart in class de.hybris.platform.commerceservices.order.impl.DefaultCommerceAddToCartStrategy
        Throws:
        de.hybris.platform.commerceservices.order.CommerceCartModificationException
      • doAddToCart

        protected CommerceCartModification doAddToCart​(CommerceCartParameter parameter)
                                                throws de.hybris.platform.commerceservices.order.CommerceCartModificationException
        Overrides:
        doAddToCart in class de.hybris.platform.commerceservices.order.impl.DefaultCommerceAddToCartStrategy
        Throws:
        de.hybris.platform.commerceservices.order.CommerceCartModificationException
      • createSubscriptionInfo

        protected TmaCartSubscriptionInfoModel createSubscriptionInfo​(PriceRowModel minimumPrice)
        Creates a new TmaCartSubscriptionInfoModel based on the information retrieved from the minimum identified price. In case no subscription term is found on the price, a default value is configured.
        Parameters:
        minimumPrice -
        Returns:
        subscriptionInfo populated with the subscription term
      • beforeAddToCart

        protected void beforeAddToCart​(CommerceCartParameter parameters)
                                throws de.hybris.platform.commerceservices.order.CommerceCartModificationException
        Overrides:
        beforeAddToCart in class de.hybris.platform.commerceservices.order.impl.AbstractCommerceAddToCartStrategy
        Throws:
        de.hybris.platform.commerceservices.order.CommerceCartModificationException
      • validateApplicableEligiblity

        protected void validateApplicableEligiblity​(CommerceCartParameter parameter)
                                             throws de.hybris.platform.commerceservices.order.CommerceCartModificationException
        Checks current user eligibility
        Parameters:
        parameter - the CommerceCartParameter
        Throws:
        de.hybris.platform.commerceservices.order.CommerceCartModificationException - the cart modification exception
      • getEnumerationService

        protected de.hybris.platform.enumeration.EnumerationService getEnumerationService()
      • setEnumerationService

        public void setEnumerationService​(de.hybris.platform.enumeration.EnumerationService enumerationService)
      • getTmaPoService

        protected TmaPoService getTmaPoService()
      • setTmaPoService

        public void setTmaPoService​(TmaPoService tmaPoService)