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
-
Field Summary
Fields inherited from class de.hybris.platform.commerceservices.order.impl.AbstractCommerceAddToCartStrategy
APPEND_AS_LASTFields inherited from class de.hybris.platform.commerceservices.order.impl.AbstractCommerceCartStrategy
DEFAULT_FORCE_IN_STOCK_MAX_QUANTITY, forceInStockMaxQuantity -
Constructor Summary
ConstructorsConstructorDescriptionTmaCommerceAddToCartStrategy(TmaCommerceCartResourceService tmaCommerceCartResourceService, TmaPriceContextService tmaPriceContextService, TmaAbstractOrderEntryService abstractOrderEntryService, List<de.hybris.platform.commerceservices.order.hook.CommerceAddToCartMethodHook> masterAddToCartEntryHooks) -
Method Summary
Modifier and TypeMethodDescriptionaddToCart(CommerceCartParameter parameter) protected List<CommerceCartModification>addToCartBpoStructure(CommerceCartParameter commerceCartParameter) Adds into cart a hierarchical structure ofCommerceCartParameterrepresenting aTmaBundledProductOfferingModelby ensuring that all components part of given BPO can be added successfully into cart.protected voidafterAddToCartMasterEntry(CommerceCartParameter commerceCartParameter, CommerceCartModification commerceCartModification) protected voidbeforeAddToCart(CommerceCartParameter parameters) protected voidbeforeAddToCartBpo(CommerceCartParameter commerceCartParameter) Performs validations for each parameter from bundled product offering structure to be added to cart.protected voidbeforeAddToCartMasterEntry(CommerceCartParameter commerceCartParameter) protected voidbuildBpoCommerceCartModificationsMap(CommerceCartParameter commerceCartParameter, Map<CommerceCartParameter, CommerceCartModification> paramModificationMap) protected voidprotected TmaCartSubscriptionInfoModelcreateSubscriptionInfo(PriceRowModel bestApplicablePrice) Creates a newTmaCartSubscriptionInfoModelbased on the information retrieved from the minimum identified price.protected CommerceCartModificationdoAddToCart(CommerceCartParameter parameter) protected TmaAbstractOrderEntryServiceprotected PriceRowModelgetBestApplicablePrice(CommerceCartParameter parameter) Deprecated.since 2105.protected TmaCommercePriceServiceprotected TmaCustomerInventoryServiceprotected de.hybris.platform.enumeration.EnumerationServiceprotected List<de.hybris.platform.commerceservices.order.hook.CommerceAddToCartMethodHook>protected TmaSubscriptionTermServiceprotected TmaCommerceCartResourceServiceprotected TmaPoServiceprotected TmaPriceContextServiceprotected CommerceCartModificationperformAddToCart(CommerceCartParameter parameter, boolean saveCartEntry) Performs add to cart for the inputCommerceCartParameterand creates the correspondingCommerceCartModificationfor the newly createdCartEntryModel.processCartAction(List<CommerceCartParameter> commerceCartParameterList) Processes cart updates.voidsetCommercePriceService(TmaCommercePriceService commercePriceService) voidsetCustomerInventoryService(TmaCustomerInventoryService customerInventoryService) voidsetEnumerationService(de.hybris.platform.enumeration.EnumerationService enumerationService) voidsetSubscriptionTermService(TmaSubscriptionTermService subscriptionTermService) voidsetTmaPoService(TmaPoService tmaPoService) protected voidupdateCartEntryDetails(CommerceCartParameter parameter, CartEntryModel entryModel) Updates new createdCartEntryModelwith details fromCommerceCartParameterrequest object.protected voidDeprecated.since 2105.Methods inherited from class de.hybris.platform.commerceservices.order.impl.DefaultCommerceAddToCartStrategy
addCartEntry, addToCart, createAddToCartResp, createEmptyCartEntry, getEntryMergeStrategy, getStatusCodeAllowedQuantityChange, getStatusCodeForNotAllowedQuantityChange, getUnit, isProductForCode, mergeEntry, setEntryMergeStrategyMethods inherited from class de.hybris.platform.commerceservices.order.impl.AbstractCommerceAddToCartStrategy
afterAddToCart, getAddToCartValidators, getCommerceAddToCartMethodHooks, getConfigurationService, getFallbackAddToCartValidator, setAddToCartValidators, setCommerceAddToCartMethodHooks, setConfigurationService, setFallbackAddToCartValidator, validateAddToCartMethods inherited from class de.hybris.platform.commerceservices.order.impl.AbstractCommerceCartStrategy
checkCartLevel, getAllowedCartAdjustmentForProduct, getAvailableStockLevel, getBaseStoreService, getCartEntryDao, getCartService, getCommerceCartCalculationStrategy, getCommerceStockService, getEntryForNumber, getEntryForProductAndPointOfService, getEntryOrderChecker, getForceInStockMaxQuantity, getModelService, getProductService, isMaxOrderQuantitySet, isOrderEntryUpdatable, isStockLevelSufficient, normalizeEntryNumbers, setBaseStoreService, setCartEntryDao, setCartService, setCommerceCartCalculationStrategy, setCommerceStockService, setEntryOrderChecker, setForceInStockMaxQuantity, setModelService, setProductService
-
Constructor Details
-
TmaCommerceAddToCartStrategy
public TmaCommerceAddToCartStrategy(TmaCommerceCartResourceService tmaCommerceCartResourceService, TmaPriceContextService tmaPriceContextService, TmaAbstractOrderEntryService abstractOrderEntryService, List<de.hybris.platform.commerceservices.order.hook.CommerceAddToCartMethodHook> masterAddToCartEntryHooks)
-
-
Method Details
-
processCartAction
public List<CommerceCartModification> processCartAction(List<CommerceCartParameter> commerceCartParameterList) throws de.hybris.platform.commerceservices.order.CommerceCartModificationException Description copied from interface:TmaCartStrategyProcesses cart updates.- Specified by:
processCartActionin interfaceTmaCartStrategy- 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:
addToCartin interfacede.hybris.platform.commerceservices.order.CommerceAddToCartStrategy- Overrides:
addToCartin classde.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:
doAddToCartin classde.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 inputCommerceCartParameterand creates the correspondingCommerceCartModificationfor the newly createdCartEntryModel.- Parameters:
parameter- contains request detailssaveCartEntry- flag indicating if the new created entry to be saved or not- Returns:
- corresponding
CommerceCartModificationfor 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 ofCommerceCartParameterrepresenting aTmaBundledProductOfferingModelby ensuring that all components part of given BPO can be added successfully into cart.- Parameters:
commerceCartParameter- commerceCartParameter representing theTmaBundledProductOfferingModelto 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
Updates new createdCartEntryModelwith details fromCommerceCartParameterrequest object.- Parameters:
parameter- contains details for updating the cart entryentryModel- cart entry to be updated
-
createSubscriptionInfo
Creates a newTmaCartSubscriptionInfoModelbased 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:
beforeAddToCartin classde.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 Deprecated.since 2105. UseTmaProcessTypeResourceStrategy.validateResource(CommerceCartParameter)instead.Checks current user eligibility- Throws:
de.hybris.platform.commerceservices.order.CommerceCartModificationException
-
getBestApplicablePrice
@Deprecated(since="2105") protected PriceRowModel getBestApplicablePrice(CommerceCartParameter parameter) Deprecated.since 2105. Use insteadTmaCommercePriceService.getBestApplicablePrice(TmaPriceContext)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
-
setTmaPoService
-
getCommercePriceService
-
setCommercePriceService
-
getSubscriptionTermService
-
setSubscriptionTermService
-
getTmaCommerceCartResourceService
-
getCustomerInventoryService
-
setCustomerInventoryService
-
getTmaPriceContextService
-
getAbstractOrderEntryService
-
getMasterAddToCartHooks
protected List<de.hybris.platform.commerceservices.order.hook.CommerceAddToCartMethodHook> getMasterAddToCartHooks()
-