Class TmaCommerceAddToCartStrategy

java.lang.Object
de.hybris.platform.commerceservices.order.impl.AbstractCommerceCartStrategy
de.hybris.platform.commerceservices.order.impl.AbstractCommerceAddToCartStrategy
de.hybris.platform.commerceservices.order.impl.DefaultCommerceAddToCartStrategy
de.hybris.platform.b2ctelcoservices.order.impl.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
  • Constructor Details

  • Method Details

    • processCartAction

      public List<CommerceCartModification> processCartAction(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
    • performAddToCart

      protected CommerceCartModification performAddToCart(CommerceCartParameter parameter, boolean saveCartEntry) throws de.hybris.platform.commerceservices.order.CommerceCartModificationException
      Performs add to cart for the input CommerceCartParameter and creates the corresponding CommerceCartModification for the newly created CartEntryModel.
      Parameters:
      parameter - contains request details
      saveCartEntry - flag indicating if the new created entry to be saved or not
      Returns:
      corresponding CommerceCartModification for the new added entry
      Throws:
      de.hybris.platform.commerceservices.order.CommerceCartModificationException - in case an error occurs
    • beforeAddToCartMasterEntry

      protected void beforeAddToCartMasterEntry(CommerceCartParameter commerceCartParameter) throws de.hybris.platform.commerceservices.order.CommerceCartModificationException
      Throws:
      de.hybris.platform.commerceservices.order.CommerceCartModificationException
    • afterAddToCartMasterEntry

      protected void afterAddToCartMasterEntry(CommerceCartParameter commerceCartParameter, CommerceCartModification commerceCartModification) throws de.hybris.platform.commerceservices.order.CommerceCartModificationException
      Throws:
      de.hybris.platform.commerceservices.order.CommerceCartModificationException
    • beforeAddToCartBpo

      protected void beforeAddToCartBpo(CommerceCartParameter commerceCartParameter) throws de.hybris.platform.commerceservices.order.CommerceCartModificationException
      Performs validations for each parameter from bundled product offering structure to be added to cart.
      Parameters:
      commerceCartParameter - corresponding bundled product offering param
      Throws:
      de.hybris.platform.commerceservices.order.CommerceCartModificationException - in case a validation error occurs
    • buildBpoCommerceCartModificationsMap

      protected void buildBpoCommerceCartModificationsMap(CommerceCartParameter commerceCartParameter, Map<CommerceCartParameter,CommerceCartModification> paramModificationMap) throws de.hybris.platform.commerceservices.order.CommerceCartModificationException
      Throws:
      de.hybris.platform.commerceservices.order.CommerceCartModificationException
    • addToCartBpoStructure

      protected List<CommerceCartModification> addToCartBpoStructure(CommerceCartParameter commerceCartParameter) throws de.hybris.platform.commerceservices.order.CommerceCartModificationException
      Adds into cart a hierarchical structure of CommerceCartParameter representing a TmaBundledProductOfferingModel by ensuring that all components part of given BPO can be added successfully into cart.
      Parameters:
      commerceCartParameter - commerceCartParameter representing the TmaBundledProductOfferingModel to be added into cart.
      Returns:
      commerceCartModifications representing the results for each BPO component
      Throws:
      de.hybris.platform.commerceservices.order.CommerceCartModificationException - in case any validation for the given BPO fails
    • checkApplicableSubscriptionTerm

      protected void checkApplicableSubscriptionTerm(CommerceCartParameter parameter) throws de.hybris.platform.commerceservices.order.CommerceCartModificationException
      Throws:
      de.hybris.platform.commerceservices.order.CommerceCartModificationException
    • updateCartEntryDetails

      protected void updateCartEntryDetails(CommerceCartParameter parameter, CartEntryModel entryModel)
      Updates new created CartEntryModel with details from CommerceCartParameter request object.
      Parameters:
      parameter - contains details for updating the cart entry
      entryModel - cart entry to be updated
    • createSubscriptionInfo

      protected TmaCartSubscriptionInfoModel createSubscriptionInfo(PriceRowModel bestApplicablePrice)
      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:
      bestApplicablePrice - The best applicable price
      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

      @Deprecated(since="2105") protected void validateApplicableEligiblity(CommerceCartParameter parameter) throws de.hybris.platform.commerceservices.order.CommerceCartModificationException
      Checks current user eligibility
      Throws:
      de.hybris.platform.commerceservices.order.CommerceCartModificationException
    • getBestApplicablePrice

      @Deprecated(since="2105") protected PriceRowModel getBestApplicablePrice(CommerceCartParameter parameter)
      Returns the best applicable price based on the information provided in the parameter.
      Parameters:
      parameter - contains attributes used for cart updates
      Returns:
      The best applicable price
    • 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)
    • getCommercePriceService

      protected TmaCommercePriceService getCommercePriceService()
    • setCommercePriceService

      public void setCommercePriceService(TmaCommercePriceService commercePriceService)
    • getSubscriptionTermService

      protected TmaSubscriptionTermService getSubscriptionTermService()
    • setSubscriptionTermService

      public void setSubscriptionTermService(TmaSubscriptionTermService subscriptionTermService)
    • getTmaCommerceCartResourceService

      protected TmaCommerceCartResourceService getTmaCommerceCartResourceService()
    • getCustomerInventoryService

      protected TmaCustomerInventoryService getCustomerInventoryService()
    • setCustomerInventoryService

      public void setCustomerInventoryService(TmaCustomerInventoryService customerInventoryService)
    • getTmaPriceContextService

      protected TmaPriceContextService getTmaPriceContextService()
    • getAbstractOrderEntryService

      protected TmaAbstractOrderEntryService getAbstractOrderEntryService()
    • getMasterAddToCartHooks

      protected List<de.hybris.platform.commerceservices.order.hook.CommerceAddToCartMethodHook> getMasterAddToCartHooks()