Class BundleAddToCartMethodHook
java.lang.Object
de.hybris.platform.configurablebundleservices.order.hook.BundleAddToCartMethodHook
- All Implemented Interfaces:
CommerceAddToCartMethodHook
Bundle-specific extension of the generic addToCart method.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddEntryGroupsToEntry(AbstractOrderEntryModel entry, Collection<Integer> entryGroupNumbers) protected voidaddToBundle(CommerceCartParameter parameter, AbstractOrderEntryModel entry) Assign the new cart entry to an existing bundle or create a new bundle for itvoidafterAddToCart(CommerceCartParameter parameter, CommerceCartModification result) Execute custom logic after adding product to cartvoidbeforeAddToCart(CommerceCartParameter parameter) Execute custom logic before adding product to cartprotected voidcheckBundleParameters(CommerceCartParameter parameter) protected voidcheckCanBeAddedToComponent(CommerceCartParameter parameter) protected voidprotected voidprotected voidcheckIsSoldIndividually(CommerceCartParameter parameter) protected BundleCartHookHelperprotected BundleCartValidatorprotected AbstractBundleComponentEditableChecker<CartModel>protected List<AbstractOrderEntryModel>getBundleEntries(AbstractOrderModel cart, Collection<Integer> entryGroupNumbers) Collects all entries of a bundle.protected EntryGroupgetBundleEntryGroup(CommerceCartParameter parameter) protected BundleRuleServiceprotected BundleTemplateServiceprotected CartServiceprotected BundleTemplateModelgetComponent(CommerceCartParameter parameter) protected EntryGroupServiceprotected EntryGroupgetGroupForComponent(EntryGroup root, String externalReferenceId) protected L10NServiceprotected booleanprotected booleanisBundledEntry(CommerceCartParameter parameter) Determines whether the entry applies to bundle.protected booleanprotected voidsetAutoPickEnabled(boolean autoPickEnabled) voidsetBundleCartHookHelper(BundleCartHookHelper bundleCartHookHelper) voidsetBundleCartValidator(BundleCartValidator bundleCartValidator) voidsetBundleComponentEditableChecker(AbstractBundleComponentEditableChecker<CartModel> bundleComponentEditableChecker) voidsetBundleRuleService(BundleRuleService bundleRuleService) voidsetBundleTemplateService(BundleTemplateService bundleTemplateService) voidsetCartService(CartService cartService) voidsetEntryGroupService(EntryGroupService entryGroupService) voidsetL10NService(L10NService l10NService) protected booleanstartingNewBundle(CommerceCartParameter parameter)
-
Constructor Details
-
BundleAddToCartMethodHook
public BundleAddToCartMethodHook()
-
-
Method Details
-
beforeAddToCart
public void beforeAddToCart(CommerceCartParameter parameter) throws CommerceCartModificationException Description copied from interface:CommerceAddToCartMethodHookExecute custom logic before adding product to cart- Specified by:
beforeAddToCartin interfaceCommerceAddToCartMethodHook- Parameters:
parameter- A parameter object- Throws:
CommerceCartModificationException
-
afterAddToCart
public void afterAddToCart(CommerceCartParameter parameter, CommerceCartModification result) throws CommerceCartModificationException Description copied from interface:CommerceAddToCartMethodHookExecute custom logic after adding product to cart- Specified by:
afterAddToCartin interfaceCommerceAddToCartMethodHook- Parameters:
parameter- A parameter objectresult- A return value of addToCart method- Throws:
CommerceCartModificationException
-
getBundleEntries
@Nonnull protected List<AbstractOrderEntryModel> getBundleEntries(@Nonnull AbstractOrderModel cart, @Nonnull Collection<Integer> entryGroupNumbers) Collects all entries of a bundle.- Parameters:
cart- the order where to take entries fromentryGroupNumbers- number of any group of the bundle- Returns:
- list of bundle entries (may be empty)
- Throws:
IllegalArgumentException- ifentryGroupNumberis not found
-
startingNewBundle
protected boolean startingNewBundle(CommerceCartParameter parameter) throws CommerceCartModificationException -
isBundledEntry
protected boolean isBundledEntry(@Nonnull CommerceCartParameter parameter) throws CommerceCartModificationException Determines whether the entry applies to bundle.- Parameters:
parameter- entry definition- Returns:
- true is it's a bundled entry
- Throws:
CommerceCartModificationException
-
getGroupForComponent
-
addEntryGroupsToEntry
protected void addEntryGroupsToEntry(@Nonnull AbstractOrderEntryModel entry, @Nonnull Collection<Integer> entryGroupNumbers) -
addToBundle
protected void addToBundle(@Nonnull CommerceCartParameter parameter, @Nonnull AbstractOrderEntryModel entry) throws CommerceCartModificationException Assign the new cart entry to an existing bundle or create a new bundle for it -
checkBundleParameters
protected void checkBundleParameters(@Nonnull CommerceCartParameter parameter) throws CommerceCartModificationException -
checkIsProductInComponentProductList
protected void checkIsProductInComponentProductList(@Nonnull CommerceCartParameter parameter) throws CommerceCartModificationException -
checkIsSoldIndividually
protected void checkIsSoldIndividually(@Nonnull CommerceCartParameter parameter) throws CommerceCartModificationException -
checkCanBeAddedToComponent
protected void checkCanBeAddedToComponent(@Nonnull CommerceCartParameter parameter) throws CommerceCartModificationException -
isCalledFromStartBundle
protected boolean isCalledFromStartBundle() -
checkIsProductDisabledByRules
protected void checkIsProductDisabledByRules(@Nonnull CommerceCartParameter parameter) throws CommerceCartModificationException -
getBundleEntryGroup
protected EntryGroup getBundleEntryGroup(CommerceCartParameter parameter) throws CommerceCartModificationException -
getComponent
protected BundleTemplateModel getComponent(@Nonnull CommerceCartParameter parameter) throws CommerceCartModificationException -
getL10NService
-
setL10NService
-
getBundleComponentEditableChecker
-
setBundleComponentEditableChecker
public void setBundleComponentEditableChecker(AbstractBundleComponentEditableChecker<CartModel> bundleComponentEditableChecker) -
getBundleRuleService
-
setBundleRuleService
-
getCartService
-
setCartService
-
getBundleCartHookHelper
-
setBundleCartHookHelper
-
getBundleTemplateService
-
setBundleTemplateService
-
getEntryGroupService
-
setEntryGroupService
-
getBundleCartValidator
-
setBundleCartValidator
-
isAutoPickEnabled
protected boolean isAutoPickEnabled() -
setAutoPickEnabled
protected void setAutoPickEnabled(boolean autoPickEnabled)
-