BundleCommerceCartService@Deprecated public class DefaultBundleCommerceCartService extends DefaultSubscriptionCommerceCartService implements BundleCommerceCartService
BundleCommerceCartService| Modifier and Type | Field and Description |
|---|---|
static int |
NEW_BUNDLE
Deprecated.
|
static int |
NO_BUNDLE
Deprecated.
|
ESTIMATED_TAXES| Constructor and Description |
|---|
DefaultBundleCommerceCartService()
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.util.List<CommerceCartModification> |
addAutoPickProductsToCart(CartModel masterCartModel,
int bundleNo,
BundleTemplateModel bundleTemplate,
UnitModel unit)
Deprecated.
Add auto-pick products to the bundle in the cart.
|
protected CommerceCartModification |
addProductToCart(CartModel masterCartModel,
ProductModel productModel,
long quantityToAdd,
UnitModel unit,
boolean forceNewEntry,
int bundleNo,
BundleTemplateModel bundleTemplateModel,
java.lang.String xmlProduct,
boolean ignoreEmptyBundle)
Deprecated.
Adds a product to the cart, either as standalone product or as part of a bundle.
|
CommerceCartModification |
addToCart(CartModel masterCartModel,
ProductModel productModel,
long quantityToAdd,
UnitModel unit,
boolean forceNewEntry)
Deprecated.
|
java.util.List<CommerceCartModification> |
addToCart(CartModel masterCartModel,
ProductModel productModel,
long quantityToAdd,
UnitModel unit,
boolean forceNewEntry,
int bundleNo,
BundleTemplateModel bundleTemplateModel,
boolean removeCurrentProducts)
Deprecated.
Since ages (at least from 5.1)
|
java.util.List<CommerceCartModification> |
addToCart(CartModel masterCartModel,
ProductModel productModel,
long quantityToAdd,
UnitModel unit,
boolean forceNewEntry,
int bundleNo,
BundleTemplateModel bundleTemplateModel,
boolean removeCurrentProducts,
java.lang.String xmlProduct)
Deprecated.
Since 6.4 - Use the generic
DefaultCommerceCartService.addToCart(CommerceCartParameter) |
CommerceCartModification |
addToCart(CartModel masterCartModel,
ProductModel productModel,
long quantityToAdd,
UnitModel unit,
boolean forceNewEntry,
java.lang.String xmlProduct)
Deprecated.
|
java.util.List<CommerceCartModification> |
addToCart(CartModel masterCartModel,
UnitModel unit,
int bundleNo,
ProductModel productModel1,
BundleTemplateModel bundleTemplateModel1,
ProductModel productModel2,
BundleTemplateModel bundleTemplateModel2)
Deprecated.
Since ages (at least from 5.1)
|
java.util.List<CommerceCartModification> |
addToCart(CartModel masterCartModel,
UnitModel unit,
int bundleNo,
ProductModel productModel1,
BundleTemplateModel bundleTemplateModel1,
ProductModel productModel2,
BundleTemplateModel bundleTemplateModel2,
java.lang.String xmlProduct1,
java.lang.String xmlProduct2)
Deprecated.
Adds the (existing)
ProductModels productModel1 and productModel2 in the given
UnitModel and with quantity=1 to the (existing) multi-cart CartModel as new cart entries. |
protected CommerceCartModification |
addToCartWithoutCalculation(CommerceCartParameter parameter)
Deprecated.
Run the addToCart in a local context where the session parameter CALCULATE_CART is set to false so that the cart
is not yet calculated.
|
boolean |
calculateCart(CartModel cartModel)
Deprecated.
Overrides the super class' method to make sure that in a multi-cart system the master cart and the child carts are
calculated.
|
java.lang.String |
checkAndGetReasonForDisabledProductInComponent(CartModel masterCart,
ProductModel product,
BundleTemplateModel bundleTemplate,
int bundleNo,
boolean ignoreCurrentProducts)
Deprecated.
Checks if the given
product which is not yet added to the cart/bundle needs to be disabled within a
component. |
java.lang.String |
checkAndGetReasonForNotRemovableEntry(CartEntryModel cartEntry)
Deprecated.
Checks whether the given
CartEntryModel could be removed from the bundle/cart (only a check, the cart is
not modified!) and returns the reason if the removal is not allowed. |
protected void |
checkAndRemoveDependentComponents(CartModel masterCartModel,
int bundleNo,
BundleTemplateModel bundleTemplate)
Deprecated.
If the last item of the given
bundleTemplate is deleted all items that belong to components which are
dependent on the given bundleTemplate are also removed from the cart. |
protected void |
checkAutoPickAddToCart(BundleTemplateModel bundleTemplate,
ProductModel product)
Deprecated.
Checks whether the given
cartEntry is an auto-pick item and throws an
CommerceCartModificationException in that case |
protected void |
checkAutoPickRemoval(CartEntryModel cartEntry)
Deprecated.
Checks whether the given
cartEntry is an auto-pick item and throws an
CommerceCartModificationException in that case |
protected void |
checkIsComponentDependencyMetAfterRemoval(CartModel masterCart,
BundleTemplateModel bundleTemplate,
int bundleNo)
Deprecated.
Checks if an item can be removed from the given
component (component). |
boolean |
checkIsComponentEditable(CartModel masterCart,
BundleTemplateModel bundleTemplate,
int bundleNo)
Deprecated.
Checks if the given component
bundleTemplate in given bundle bundleNo and
masterCart can be edited. |
boolean |
checkIsComponentSelectionCriteriaMet(CartModel masterCart,
BundleTemplateModel bundleTemplate,
int bundleNo)
Deprecated.
Checks if the selection criteria of the given component
bundleTemplate in given bundle
bundleNo and masterCart is met. |
boolean |
checkIsEntryRemovable(CartEntryModel cartEntry)
Deprecated.
Checks whether the given
CartEntryModel could be removed from the bundle/cart (only a check, the cart is
not modified!). |
boolean |
checkIsEntryUpdateable(CartEntryModel cartEntry)
Deprecated.
Checks whether the given
cartEntry can be updated. |
protected void |
checkIsProductAlreadyInComponent(CartModel masterCart,
int bundleNo,
BundleTemplateModel bundleTemplate,
ProductModel product)
Deprecated.
Checks whether the given
product is already added to the given bundleNo and
component. |
protected void |
checkIsSelectionCriteriaNotExceeded(CartModel masterCart,
BundleTemplateModel bundleTemplate,
int bundleNo)
Deprecated.
Checks that not too many products are added to the given
bundleNo within the given
component (component) in the given masterCart. |
protected void |
checkSelectionCriteriaNotUnderThreshold(CartEntryModel cartEntry)
Deprecated.
|
protected BundleTemplateModel |
findAnyRequiredTemplate(CartModel masterCart,
BundleTemplateModel bundleTemplate,
int bundleNo)
Deprecated.
|
protected OrderEntryDao |
getBundleCartEntryDao()
Deprecated.
|
protected AbstractBundleComponentEditableChecker<CartModel> |
getBundleComponentEditableChecker()
Deprecated.
|
protected BundleRuleService |
getBundleRuleService()
Deprecated.
|
protected BundleTemplateService |
getBundleTemplateService()
Deprecated.
|
java.util.List<CartEntryModel> |
getCartEntriesForBundle(CartModel masterCart,
int bundleNo)
Deprecated.
Gets the list of for bundleNo.
|
java.util.List<CartEntryModel> |
getCartEntriesForComponentInBundle(CartModel masterCart,
BundleTemplateModel component,
int bundleNo)
Deprecated.
Gets the list of
CartEntryModel for component and bundleNo. |
java.util.List<CartEntryModel> |
getCartEntriesForProductInBundle(CartModel masterCart,
ProductModel product,
int bundleNo)
Deprecated.
Gets the list of
CartEntryModel for Products and bundleNo. |
protected java.lang.String |
getDisablingReason(CartModel masterCart,
ProductModel product,
BundleTemplateModel bundleTemplate,
int bundleNo,
boolean ignoreCurrentProducts)
Deprecated.
|
protected java.lang.Integer |
getEntryGroupFor(AbstractOrderModel cartModel,
int bundleNo,
BundleTemplateModel component)
Deprecated.
Restores entry group number by given component and bundle number.
|
protected EntryGroupService |
getEntryGroupService()
Deprecated.
|
BundleTemplateModel |
getFirstInvalidComponentInCart(CartModel masterCart)
Deprecated.
Checks the given
masterCart if there are invalid components in it. |
protected L10NService |
getL10NService()
Deprecated.
|
BillingTimeModel |
getMasterBillingTime()
Deprecated.
Get the master
BillingTimeModel |
protected java.lang.Integer |
getNextFreeBundleNo(AbstractOrderModel order)
Deprecated.
|
protected ModifiableChecker<AbstractOrderEntryModel> |
getOrderEntryModifiableChecker()
Deprecated.
|
protected RemoveableChecker<CartEntryModel> |
getRemovableChecker()
Deprecated.
|
protected java.lang.String |
getSelectionCriterionMessage(CartModel masterCart,
BundleTemplateModel bundleTemplate,
int bundleNo)
Deprecated.
|
SessionService |
getSessionService()
Deprecated.
|
void |
removeAllEntries(CartModel masterCartModel,
int bundleNo)
Deprecated.
Removes a bundle from the given
CartModel and its child carts. |
protected void |
removeCartEntry(CartModel masterCartModel,
CartEntryModel cartEntry)
Deprecated.
Removes a cart entry without performing any validation checks.
|
protected void |
removeEntriesWithChildren(java.util.List<CartEntryModel> cartEntries,
CartModel masterCartModel)
Deprecated.
|
void |
setBundleCartEntryDao(OrderEntryDao cartEntryDao)
Deprecated.
|
void |
setBundleComponentEditableChecker(AbstractBundleComponentEditableChecker<CartModel> bundleComponentEditableChecker)
Deprecated.
|
void |
setBundleRuleService(BundleRuleService bundleRuleService)
Deprecated.
|
void |
setBundleTemplateService(BundleTemplateService bundleTemplateService)
Deprecated.
|
protected void |
setCartEntriesInSameBundleToNotCalculated(AbstractOrderEntryModel sourceEntry)
Deprecated.
Sets all other cart entries that belong to the same bundle to "not calculated".
|
void |
setEntryGroupService(EntryGroupService entryGroupService)
Deprecated.
|
void |
setL10NService(L10NService l10NService)
Deprecated.
|
void |
setOrderEntryModifiableChecker(ModifiableChecker<AbstractOrderEntryModel> orderEntryModifiableChecker)
Deprecated.
|
void |
setRemovableChecker(RemoveableChecker<CartEntryModel> removableChecker)
Deprecated.
|
protected void |
updateLastModifiedEntriesList(CartModel masterCart,
java.util.List<CommerceCartModification> modifications)
Deprecated.
|
CommerceCartModification |
updateQuantityForCartEntry(CommerceCartParameter parameter)
Deprecated.
Update quantity for the cart entry with given
entryNumber with the given newQuantity. |
addOneRecurringFrequency, addToCart, checkMasterCart, checkQuantityToAdd, checkQuantityToAdd, createChildCartForBillingTime, getAvailableStockLevel, getBaseStoreService, getBillingFrequenciesForMasterEntry, getBillingTimeForCode, getBillingTimeService, getCartEntryToBeUpdated, getChildCartForBillingTime, getCommercePriceService, getCommerceStockService, getMasterCartBillingTimeCode, getMasterCartForCartEntry, getSubscriptionCommerceCartStrategy, getSubscriptionProductService, getSubscriptionProductStockQuantity, isMasterCart, recalculateCart, recalculateCart, removeAllEntries, setBaseStoreService, setBillingTimeService, setCommercePriceService, setCommerceStockService, setMasterCartBillingTimeCode, setSubscriptionCommerceCartStrategy, setSubscriptionProductService, setSubscriptionProductStockQuantity, useBillingFrequencyForProductaddToCart, addToCart, afterCalculate, beforeCalculate, calculateCart, configureCartEntry, estimateTaxes, estimateTaxes, getBaseSiteService, getCartForCodeAndUser, getCartForGuidAndSite, getCartForGuidAndSiteAndUser, getCartsForSiteAndUser, getCartValidationStrategy, getCommerceAddToCartStrategy, getCommerceCartCalculationStrategy, getCommerceCartDao, getCommerceCartEstimateTaxesStrategy, getCommerceCartHashCalculationStrategy, getCommerceCartMergingStrategy, getCommerceCartMetadataUpdateStrategy, getCommerceCartRestorationStrategy, getCommerceCartSplitStrategy, getCommerceRemoveEntriesStrategy, getCommerceUpdateCartEntryStrategy, getModelService, getProductConfigurationStrategy, getRemoveEntryGroupStrategy, getStaleCartRemovalStrategy, mergeCarts, removeAllEntries, removeEntryGroup, removeStaleCarts, removeStaleCarts, restoreCart, restoreCart, setBaseSiteService, setCartValidationStrategy, setCommerceAddToCartStrategy, setCommerceCartCalculationStrategy, setCommerceCartDao, setCommerceCartEstimateTaxesStrategy, setCommerceCartHashCalculationStrategy, setCommerceCartMergingStrategy, setCommerceCartMetadataUpdateStrategy, setCommerceCartRestorationStrategy, setCommerceCartSplitStrategy, setCommerceRemoveEntriesStrategy, setCommerceUpdateCartEntryStrategy, setModelService, setProductConfigurationStrategy, setRemoveEntryGroupStrategy, setSessionService, setStaleCartRemovalStrategy, split, split, updateCartMetadata, updatePointOfServiceForCartEntry, updatePointOfServiceForCartEntry, updateQuantityForCartEntry, updateToShippingModeForCartEntry, updateToShippingModeForCartEntry, validateCart, validateCartclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddToCart, checkMasterCart, checkQuantityToAdd, createChildCartForBillingTime, getBillingFrequenciesForMasterEntry, getChildCartForBillingTime, getMasterCartBillingTimeCode, getMasterCartForCartEntryaddToCart, addToCart, calculateCart, configureCartEntry, estimateTaxes, estimateTaxes, getCartForCodeAndUser, getCartForGuidAndSite, getCartForGuidAndSiteAndUser, getCartsForSiteAndUser, mergeCarts, recalculateCart, recalculateCart, removeAllEntries, removeAllEntries, removeEntryGroup, removeStaleCarts, removeStaleCarts, restoreCart, restoreCart, split, split, updateCartMetadata, updatePointOfServiceForCartEntry, updatePointOfServiceForCartEntry, updateQuantityForCartEntry, updateToShippingModeForCartEntry, updateToShippingModeForCartEntry, validateCart, validateCartpublic static final int NO_BUNDLE
public static final int NEW_BUNDLE
public DefaultBundleCommerceCartService()
@Deprecated public java.util.List<CommerceCartModification> addToCart(CartModel masterCartModel, ProductModel productModel, long quantityToAdd, UnitModel unit, boolean forceNewEntry, int bundleNo, BundleTemplateModel bundleTemplateModel, boolean removeCurrentProducts) throws CommerceCartModificationException
BundleCommerceCartServiceProductModel in the given UnitModel and with the given quantity
to the (existing) CartModel. If an entry with the given product and given unit exists in the cart already,
then the given quantity is added to the quantity of this cart entry unless forceNewEntry
is set to true or a subscription product or a product, that is part of a bundle, is added. Dependent on the
parameter bundleNo the product is added to an existing or new bundle or treated as a standalone
product. In case a new bundle is created the method also adds auto-pick products to the cart if there are any
setup for the bundle template. After this the multi-cart is calculated.addToCart in interface BundleCommerceCartServicemasterCartModel - the cart model. It must exist and it must be a master cart.productModel - the product model that will be added to the cartquantityToAdd - the quantity of the productunit - if null ProductService.getOrderableUnit(ProductModel) is used to determine the unitforceNewEntry - the force new entry if set to true, new cart entry will be created in any case. In case of subscription
products and products that are part of a bundle there will be always a new cart entrybundleNo - indicates to which bundle the product model shall be added (-1=create new bundle; 0=standalone
product/no bundle; >0=number of existing bundle)bundleTemplateModel - current version of the bundleTemplate model based on which the product is added to the cart. It will be
stored on the cart entry. If null the product will be treated as a standalone product and
the bundleNo must be 0 accordingly.removeCurrentProducts - whether to remove current productsCommerceCartModification that includes a statusCode and the
actual quantity of the products added to the cartCommerceCartModificationException - if the product is a base product OR the quantity is less than 1 or no usable unit was
found (only when given unit is also null) or any other reason the cart could
not be modified.@Deprecated public java.util.List<CommerceCartModification> addToCart(CartModel masterCartModel, ProductModel productModel, long quantityToAdd, UnitModel unit, boolean forceNewEntry, int bundleNo, BundleTemplateModel bundleTemplateModel, boolean removeCurrentProducts, java.lang.String xmlProduct) throws CommerceCartModificationException
DefaultCommerceCartService.addToCart(CommerceCartParameter)addToCart in interface BundleCommerceCartServiceCommerceCartModification that includes a statusCode and the
actual quantity of the products added to the cartCommerceCartModificationExceptionBundleCommerceCartService.addToCart(CartModel, ProductModel, long, UnitModel, boolean, int,
BundleTemplateModel, boolean)protected CommerceCartModification addProductToCart(CartModel masterCartModel, ProductModel productModel, long quantityToAdd, UnitModel unit, boolean forceNewEntry, int bundleNo, BundleTemplateModel bundleTemplateModel, java.lang.String xmlProduct, boolean ignoreEmptyBundle) throws CommerceCartModificationException
protected java.lang.Integer getNextFreeBundleNo(AbstractOrderModel order)
protected CommerceCartModification addToCartWithoutCalculation(CommerceCartParameter parameter) throws CommerceCartModificationException
parameter - product parametersCommerceCartModificationException - if the addition failedprotected java.lang.Integer getEntryGroupFor(AbstractOrderModel cartModel, int bundleNo, BundleTemplateModel component)
For compatibility to the old version.
cartModel - cart to search inbundleNo - bundle idcomponent - bundle component (should be a leaf)@Deprecated public java.util.List<CommerceCartModification> addToCart(CartModel masterCartModel, UnitModel unit, int bundleNo, ProductModel productModel1, BundleTemplateModel bundleTemplateModel1, ProductModel productModel2, BundleTemplateModel bundleTemplateModel2) throws CommerceCartModificationException
addToCart in interface BundleCommerceCartServiceList of CommerceCartModificationsCommerceCartModificationExceptionBundleCommerceCartService.addToCart(CartModel, UnitModel, int, ProductModel, BundleTemplateModel,
ProductModel, BundleTemplateModel, String, String)public java.util.List<CommerceCartModification> addToCart(CartModel masterCartModel, UnitModel unit, int bundleNo, ProductModel productModel1, BundleTemplateModel bundleTemplateModel1, ProductModel productModel2, BundleTemplateModel bundleTemplateModel2, java.lang.String xmlProduct1, java.lang.String xmlProduct2) throws CommerceCartModificationException
BundleCommerceCartServiceProductModels productModel1 and productModel2 in the given
UnitModel and with quantity=1 to the (existing) multi-cart CartModel as new cart entries. As this
method works for bundles only, both products must have a bundle template and must be part of an existing bundle or
a new bundle that is created during the addToCart. In case a new bundle is created the method also adds auto-pick
products to the cart if there are any setup for the bundle template. After this the multi-cart is calculated.addToCart in interface BundleCommerceCartServicemasterCartModel - the cart model. It must exist and it must be a master cart.unit - if null ProductService.getOrderableUnit(ProductModel) is used to determine the unitbundleNo - indicates to which bundle the product model shall be added (-1=create new bundle; >0=number of existing
bundle; 0=standalone product/no bundle is not allowed here)productModel1 - the first product model that will be added to the cartbundleTemplateModel1 - current version of the bundleTemplate model based on which the first product is added to the cart. It
will be stored on the cart entry. The parameter cannot be null.productModel2 - the second product model that will be added to the cartbundleTemplateModel2 - current version of the bundleTemplate model based on which the second product is added to the cart. It
will be stored on the cart entry. The parameter cannot be null.xmlProduct1 - first product in xml formatxmlProduct2 - second product in xml formatCommerceCartModification that includes a statusCode and the
actual quantity of the products added to the cartCommerceCartModificationException - if the product is a base product OR the quantity is less than 1 or no usable unit was
found (only when given unit is also null) or the bundle parameters were
empty/wrong or any other reason the cart could not be modified.public CommerceCartModification addToCart(CartModel masterCartModel, ProductModel productModel, long quantityToAdd, UnitModel unit, boolean forceNewEntry) throws CommerceCartModificationException
addToCart in interface CommerceCartServiceaddToCart in class DefaultSubscriptionCommerceCartServicemasterCartModel - the user's cart in sessionproductModel - the ProductModel to addquantityToAdd - the quantity to addunit - the UnitModel of the product @see
ProductModel.getUnit()forceNewEntry - the flag for creating a new
CartEntryModelCommerceCartModificationExceptionpublic CommerceCartModification addToCart(CartModel masterCartModel, ProductModel productModel, long quantityToAdd, UnitModel unit, boolean forceNewEntry, java.lang.String xmlProduct) throws CommerceCartModificationException
addToCart in interface SubscriptionCommerceCartServiceaddToCart in class DefaultSubscriptionCommerceCartServicemasterCartModel - master cartproductModel - the ProductModel to addquantityToAdd - the quantity to addunit - the UnitModel of the productforceNewEntry - the flag for creating a newCommerceCartModificationExceptionpublic CommerceCartModification updateQuantityForCartEntry(CommerceCartParameter parameter) throws CommerceCartModificationException
CommerceCartServiceentryNumber with the given newQuantity.
Then cart is calculated.updateQuantityForCartEntry in interface CommerceCartServiceupdateQuantityForCartEntry in class DefaultCommerceCartServiceparameter - - A parameter object containing all attributes needed for add to cart
CommerceCartParameter.cart - The user's cart in session
CommerceCartParameter.pointOfService - The store object for pick up in store items (only needs
to be passed in if you are adding an item to pick up CommerceCartParameter.product - The
ProductModel to add CommerceCartParameter.quantity - The quantity to add
CommerceCartParameter.unit - The UnitModel of the product @see
ProductModel.getUnit()
CommerceCartParameter.createNewEntry - The flag for creating a new
CartEntryModel
CommerceCartModificationException - if the product is a base product OR the quantity is less than 1 or no usable unit was
found (only when given unit is also null) or any other reason the cart could
not be modified.protected void setCartEntriesInSameBundleToNotCalculated(AbstractOrderEntryModel sourceEntry)
protected void checkIsProductAlreadyInComponent(CartModel masterCart, int bundleNo, BundleTemplateModel bundleTemplate, ProductModel product) throws CommerceCartModificationException
product is already added to the given bundleNo and
component. As it is not allowed to add the same product more than once to the same component an
CommerceCartModificationException is thrown in case the product is already in the component.protected void checkIsSelectionCriteriaNotExceeded(CartModel masterCart, BundleTemplateModel bundleTemplate, int bundleNo) throws CommerceCartModificationException
bundleNo within the given
component (component) in the given masterCart. The check is based on the
selectionCriteria of the given component which limit the max. possible product selections.public boolean checkIsEntryRemovable(CartEntryModel cartEntry)
BundleCommerceCartServiceCartEntryModel could be removed from the bundle/cart (only a check, the cart is
not modified!). The check is based on the selectionCritera of the given cartEntry's component (bundle
template). If with the removal of the given cartEntry the lower limit of required product selections
would not be met any more, the check returns false, otherwise true.checkIsEntryRemovable in interface BundleCommerceCartServicecartEntry - cart entry that is checked whether it can be removed from the cart/bundletrue if the given cartEntry can be removed from the cart, otherwise
falsepublic java.lang.String checkAndGetReasonForNotRemovableEntry(CartEntryModel cartEntry)
BundleCommerceCartServiceCartEntryModel could be removed from the bundle/cart (only a check, the cart is
not modified!) and returns the reason if the removal is not allowed. The check is based on the selectionCritera of
the given cartEntry's component (bundle template). If with the removal of the given
cartEntry the lower limit of required product selections would not be met any more, the check returns
the reason as String, otherwise null.checkAndGetReasonForNotRemovableEntry in interface BundleCommerceCartServicecartEntry - cart entry that is checked whether it can be removed from the cart/bundleString why the given cartEntry cannot be removed, otherwise
nullprotected void checkSelectionCriteriaNotUnderThreshold(CartEntryModel cartEntry) throws CommerceCartModificationException
protected void checkAutoPickRemoval(CartEntryModel cartEntry) throws CommerceCartModificationException
cartEntry is an auto-pick item and throws an
CommerceCartModificationException in that caseprotected void checkAutoPickAddToCart(BundleTemplateModel bundleTemplate, ProductModel product) throws CommerceCartModificationException
cartEntry is an auto-pick item and throws an
CommerceCartModificationException in that caseprotected java.util.List<CommerceCartModification> addAutoPickProductsToCart(CartModel masterCartModel, int bundleNo, BundleTemplateModel bundleTemplate, UnitModel unit) throws CommerceCartModificationException
public void removeAllEntries(CartModel masterCartModel, int bundleNo) throws CommerceCartModificationException
BundleCommerceCartServiceCartModel and its child carts. The given CartModel must be a
master cart. All entries within the multi-cart (master + child carts) that belong to the same bundle identified by
the given bundleNo are removed from the multi cart.removeAllEntries in interface BundleCommerceCartServicemasterCartModel - the CartModel. It must exist and it must be a master cart.bundleNo - the number of the bundleCommerceCartModificationException - if the given CartModel is not a master cartprotected void checkAndRemoveDependentComponents(CartModel masterCartModel, int bundleNo, BundleTemplateModel bundleTemplate)
bundleTemplate is deleted all items that belong to components which are
dependent on the given bundleTemplate are also removed from the cart. Only components that have a
direct dependency on the given bundleTemplate are deleted. Components that have an indirect
dependency (via a 3rd component) are not removed (this method has to be overridden to implement this feature).protected void removeEntriesWithChildren(java.util.List<CartEntryModel> cartEntries, CartModel masterCartModel)
protected void removeCartEntry(CartModel masterCartModel, CartEntryModel cartEntry)
public boolean calculateCart(CartModel cartModel)
calculateCart in interface CommerceCartServicecalculateCart in class DefaultCommerceCartServicecartModel - the user's cart in sessionfalse if the cartModel was already calculatedpublic boolean checkIsEntryUpdateable(CartEntryModel cartEntry)
BundleCommerceCartServicecartEntry can be updated. Any cart entry CartEntryModel belonging to
a bundle BundleTemplateModel cannot be updated.checkIsEntryUpdateable in interface BundleCommerceCartServicecartEntry - cart Entry that is checkedtrue if given cartEntry can be update, otherwise falsepublic boolean checkIsComponentEditable(CartModel masterCart, BundleTemplateModel bundleTemplate, int bundleNo)
BundleCommerceCartServicebundleTemplate in given bundle bundleNo and
masterCart can be edited. The check is based on the selection dependencies of the given
bundleTemplate. In case the given bundleTemplate's selection criteria is of type
AutoPickBundleSelectionCriteriaModel, it is never editable.checkIsComponentEditable in interface BundleCommerceCartServicemasterCart - the master cart the bundle is inbundleTemplate - the component that is checked whether it can be editedbundleNo - the number of the bundle the given bundleTemplate belongs totrue if the selection dependencies are fulfilled and the component can be edited, otherwise
falsepublic boolean checkIsComponentSelectionCriteriaMet(CartModel masterCart, BundleTemplateModel bundleTemplate, int bundleNo)
BundleCommerceCartServicebundleTemplate in given bundle
bundleNo and masterCart is met.checkIsComponentSelectionCriteriaMet in interface BundleCommerceCartServicemasterCart - the master cart the bundle is inbundleTemplate - the component that is checked whether its selection criteria is metbundleNo - the number of the bundle the given bundleTemplate belongs totrue if given bundleTemplate's's selection criteria is met, otherwise
falseprotected void checkIsComponentDependencyMetAfterRemoval(CartModel masterCart, BundleTemplateModel bundleTemplate, int bundleNo) throws CommerceCartModificationException
component (component). If the given
component becomes invalid or would be removed completely (if last item is deleted), other components
in the same bundle would also become invalid if they have a dependency on the given component. In that case an
exception is thrownprotected BundleTemplateModel findAnyRequiredTemplate(CartModel masterCart, BundleTemplateModel bundleTemplate, int bundleNo)
public java.lang.String checkAndGetReasonForDisabledProductInComponent(CartModel masterCart, ProductModel product, BundleTemplateModel bundleTemplate, int bundleNo, boolean ignoreCurrentProducts)
BundleCommerceCartServiceproduct which is not yet added to the cart/bundle needs to be disabled within a
component. A product needs to be disabled if a disable rule is applicable (see description of method
isProductDisabledInBundle() above) and/or the selection criteria of the component is exceeded. If the given
product needs to be disabled the reason is returned as String. If ignoreCurrentProducts
is enabled, then all product of the current component will be ignored when finding disable rules.checkAndGetReasonForDisabledProductInComponent in interface BundleCommerceCartServicemasterCart - the master cart the bundle is inproduct - the product which is to be added to the given bundleNobundleTemplate - the component to which the given product is linkedbundleNo - the number of the bundle the given bundleTemplate and product belong to or
will be addedignoreCurrentProducts - if current products should be ignoredString why the given product needs to be disabled, otherwise
nullprotected java.lang.String getSelectionCriterionMessage(CartModel masterCart, BundleTemplateModel bundleTemplate, int bundleNo)
protected java.lang.String getDisablingReason(CartModel masterCart, ProductModel product, BundleTemplateModel bundleTemplate, int bundleNo, boolean ignoreCurrentProducts)
public java.util.List<CartEntryModel> getCartEntriesForProductInBundle(CartModel masterCart, ProductModel product, int bundleNo)
BundleCommerceCartServiceCartEntryModel for Products and bundleNo.getCartEntriesForProductInBundle in interface BundleCommerceCartServicemasterCart - the master cart the bundle is inproduct - the product for which the cartentries should be foundbundleNo - the bundleNo for which the cartentries should be foundpublic java.util.List<CartEntryModel> getCartEntriesForComponentInBundle(CartModel masterCart, BundleTemplateModel component, int bundleNo)
BundleCommerceCartServiceCartEntryModel for component and bundleNo.getCartEntriesForComponentInBundle in interface BundleCommerceCartServicemasterCart - the master cart the bundle is incomponent - the component for which the cartentries should be foundbundleNo - the bundleNo for which the cartentries should be foundpublic java.util.List<CartEntryModel> getCartEntriesForBundle(CartModel masterCart, int bundleNo)
BundleCommerceCartServicegetCartEntriesForBundle in interface BundleCommerceCartServicemasterCart - the master cart the bundle is inbundleNo - the bundleNo for which the cartEntries should be foundCartEntryModel with specific bundle numberpublic BundleTemplateModel getFirstInvalidComponentInCart(CartModel masterCart)
BundleCommerceCartServicemasterCart if there are invalid components in it.getFirstInvalidComponentInCart in interface BundleCommerceCartServiceBundleTemplateModel if there is one, otherwise nullprotected void updateLastModifiedEntriesList(CartModel masterCart, java.util.List<CommerceCartModification> modifications)
public void setBundleTemplateService(BundleTemplateService bundleTemplateService)
protected BundleTemplateService getBundleTemplateService()
public void setBundleCartEntryDao(OrderEntryDao cartEntryDao)
protected OrderEntryDao getBundleCartEntryDao()
protected RemoveableChecker<CartEntryModel> getRemovableChecker()
public void setRemovableChecker(RemoveableChecker<CartEntryModel> removableChecker)
public void setOrderEntryModifiableChecker(ModifiableChecker<AbstractOrderEntryModel> orderEntryModifiableChecker)
protected ModifiableChecker<AbstractOrderEntryModel> getOrderEntryModifiableChecker()
public void setBundleComponentEditableChecker(AbstractBundleComponentEditableChecker<CartModel> bundleComponentEditableChecker)
protected AbstractBundleComponentEditableChecker<CartModel> getBundleComponentEditableChecker()
public void setBundleRuleService(BundleRuleService bundleRuleService)
protected BundleRuleService getBundleRuleService()
public BillingTimeModel getMasterBillingTime()
BundleCommerceCartServiceBillingTimeModelgetMasterBillingTime in interface BundleCommerceCartServiceBillingTimeModelpublic void setL10NService(L10NService l10NService)
protected L10NService getL10NService()
public SessionService getSessionService()
getSessionService in class DefaultCommerceCartServiceprotected EntryGroupService getEntryGroupService()
public void setEntryGroupService(EntryGroupService entryGroupService)
Copyright © 2018 SAP SE. All Rights Reserved.