public interface CommerceCartService
| Modifier and Type | Method and Description |
|---|---|
CommerceCartModification |
addToCart(CartModel cartModel,
ProductModel productModel,
long quantity,
UnitModel unit,
boolean forceNewEntry)
Deprecated.
|
CommerceCartModification |
addToCart(CartModel cartModel,
ProductModel productModel,
PointOfServiceModel deliveryPointOfService,
long quantity,
UnitModel unit,
boolean forceNewEntry)
Deprecated.
|
CommerceCartModification |
addToCart(CommerceCartParameter parameter)
Adds to the (existing)
CartModel the (existing) ProductModel in the given UnitModel and
with the given quantity. |
boolean |
calculateCart(CartModel cartModel)
Deprecated.
Since 5.2. Use
calculateCart(de.hybris.platform.commerceservices.service.data.CommerceCartParameter)
instead. |
boolean |
calculateCart(CommerceCartParameter parameter)
Calculates the given
cartModel and returns true if each entry alone and after this the
CartModel was calculated. |
void |
configureCartEntry(CommerceCartParameter parameters)
Update configuration on a configurable product.
|
java.math.BigDecimal |
estimateTaxes(CartModel cartModel,
java.lang.String deliveryZipCode,
java.lang.String deliveryCountryIso)
Deprecated.
Since 5.2. Use
estimateTaxes(de.hybris.platform.commerceservices.service.data.CommerceCartParameter)
instead. |
CommerceTaxEstimateResult |
estimateTaxes(CommerceCartParameter parameters)
Estimate taxes for the cartModel and using the deliveryZipCode as the delivery zip code.
|
CartModel |
getCartForCodeAndUser(java.lang.String code,
UserModel user)
Locate a cart for the specified guid and site and user.
|
CartModel |
getCartForGuidAndSite(java.lang.String guid,
BaseSiteModel site)
Locate a cart for the specified guid and site
|
CartModel |
getCartForGuidAndSiteAndUser(java.lang.String guid,
BaseSiteModel site,
UserModel user)
Locate a cart for the specified guid and site and user.
|
java.util.List<CartModel> |
getCartsForSiteAndUser(BaseSiteModel site,
UserModel user)
Locate all carts for the specified site and user.
|
void |
mergeCarts(CartModel fromCart,
CartModel toCart,
java.util.List<CommerceCartModification> modifications)
Merge two carts and add modifications
|
void |
recalculateCart(CartModel cartModel)
Deprecated.
Since 5.2. Use
recalculateCart(de.hybris.platform.commerceservices.service.data.CommerceCartParameter)
instead |
void |
recalculateCart(CommerceCartParameter parameter)
Recalculates the whole cart and all its entries.
|
void |
removeAllEntries(CartModel cartModel)
Deprecated.
Since 5.2. Use
removeAllEntries(de.hybris.platform.commerceservices.service.data.CommerceCartParameter)
instead |
void |
removeAllEntries(CommerceCartParameter parameter)
Removes all entries from the given
CartModel. |
CommerceCartModification |
removeEntryGroup(RemoveEntryGroupParameter parameters)
Remove entry group and all cart entries of the group and it's descendants from the cart.
|
void |
removeStaleCarts(CartModel currentCart,
BaseSiteModel baseSite,
UserModel user)
Deprecated.
Since 5.2. Use
removeStaleCarts(de.hybris.platform.commerceservices.service.data.CommerceCartParameter)
instead. |
void |
removeStaleCarts(CommerceCartParameter parameters) |
CommerceCartRestoration |
restoreCart(CartModel oldCart)
Deprecated.
|
CommerceCartRestoration |
restoreCart(CommerceCartParameter parameters)
Restores the current customer's cart.
|
long |
split(CartModel cartModel,
long entryNumber)
Deprecated.
|
long |
split(CommerceCartParameter parameters)
Split existing cart entry.
|
void |
updateCartMetadata(CommerceCartMetadataParameter parameter)
Updates cart metadata, such as: name, description, expiration time.
|
CommerceCartModification |
updatePointOfServiceForCartEntry(CartModel cartModel,
long entryNumber,
PointOfServiceModel pointOfServiceModel)
Deprecated.
|
CommerceCartModification |
updatePointOfServiceForCartEntry(CommerceCartParameter parameters)
Updates given cart entry model with point of service.
|
CommerceCartModification |
updateQuantityForCartEntry(CartModel cartModel,
long entryNumber,
long newQuantity)
Deprecated.
|
CommerceCartModification |
updateQuantityForCartEntry(CommerceCartParameter parameter)
Update quantity for the cart entry with given
entryNumber with the given newQuantity. |
CommerceCartModification |
updateToShippingModeForCartEntry(CartModel cartModel,
long entryNumber)
Deprecated.
|
CommerceCartModification |
updateToShippingModeForCartEntry(CommerceCartParameter parameters)
Update the shipping mode for a given cart entry
|
java.util.List<CommerceCartModification> |
validateCart(CartModel cartModel)
Deprecated.
|
java.util.List<CommerceCartModification> |
validateCart(CommerceCartParameter parameter)
Method for validating every entry in the cart
|
@Deprecated CommerceCartModification addToCart(CartModel cartModel, ProductModel productModel, long quantity, UnitModel unit, boolean forceNewEntry) throws CommerceCartModificationException
addToCart(de.hybris.platform.commerceservices.service.data.CommerceCartParameter)cartModel - the user's cart in sessionproductModel - the ProductModel to addquantity - the quantity to addunit - the UnitModel of the product @see
ProductModel.getUnit()forceNewEntry - the flag for creating a new
CartEntryModelCommerceCartModificationExceptionCommerceCartModification addToCart(CommerceCartParameter parameter) throws CommerceCartModificationException
CartModel the (existing) ProductModel in the given UnitModel and
with the given quantity. If in the cart already an entry with the given product and given unit exists
the given quantity is added to the the quantity of this cart entry unless forceNewEntry
is set to true. After this the cart is calculated.parameter - - 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.@Deprecated CommerceCartModification addToCart(CartModel cartModel, ProductModel productModel, PointOfServiceModel deliveryPointOfService, long quantity, UnitModel unit, boolean forceNewEntry) throws CommerceCartModificationException
addToCart(de.hybris.platform.commerceservices.service.data.CommerceCartParameter)cartModel - the user's cart in sessionproductModel - the ProductModel to adddeliveryPointOfService - the delivery storequantity - the quantity to addunit - the UnitModel of the product @see
ProductModel.getUnit()forceNewEntry - the flag for creating a new
CartEntryModelCommerceCartModificationExceptionjava.util.List<CommerceCartModification> validateCart(CommerceCartParameter parameter) throws CommerceCartModificationException
parameter - CommerceCartModificationException - if the cart could not be modified.@Deprecated java.util.List<CommerceCartModification> validateCart(CartModel cartModel) throws CommerceCartModificationException
validateCart(de.hybris.platform.commerceservices.service.data.CommerceCartParameter)cartModel - the user's cart in sessionList of cart modificationsCommerceCartModificationExceptionboolean calculateCart(CommerceCartParameter parameter)
cartModel and returns true if each entry alone and after this the
CartModel was calculated. Thereby any invalid entry will be automatically removed. The net/gross prices
depends on the current session user, see PriceFactory.isNetUser(de.hybris.platform.jalo.user.User) for
more information.parameter - the parameter object holding the existing CartModel that will be calculatedfalse if the cartModel was already calculated.@Deprecated boolean calculateCart(CartModel cartModel)
calculateCart(de.hybris.platform.commerceservices.service.data.CommerceCartParameter)
instead.cartModel - the user's cart in sessionfalse if the cartModel was already calculated@Deprecated void recalculateCart(CartModel cartModel) throws CalculationException
recalculateCart(de.hybris.platform.commerceservices.service.data.CommerceCartParameter)
insteadcartModel - the user's cart in sessionCalculationExceptionvoid recalculateCart(CommerceCartParameter parameter) throws CalculationException
parameter - A parameter object holding the cart model CartModel (must exist) that will be recalculated
CartModelCalculationException - the calculation exception@Deprecated void removeAllEntries(CartModel cartModel)
removeAllEntries(de.hybris.platform.commerceservices.service.data.CommerceCartParameter)
insteadcartModel - the user's cart in sessionvoid removeAllEntries(CommerceCartParameter parameter)
CartModel.parameter - A parameter object holding the CartModel that will be emptied@Deprecated CommerceCartModification updateQuantityForCartEntry(CartModel cartModel, long entryNumber, long newQuantity) throws CommerceCartModificationException
updateQuantityForCartEntry(de.hybris.platform.commerceservices.service.data.CommerceCartParameter)cartModel - the user's cart in sessionentryNumber - the cart entry numbernewQuantity - the new quantityCommerceCartModificationExceptionCommerceCartModification updateQuantityForCartEntry(CommerceCartParameter parameter) throws CommerceCartModificationException
entryNumber with the given newQuantity.
Then cart is calculated.parameter - - 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.@Deprecated CommerceCartModification updatePointOfServiceForCartEntry(CartModel cartModel, long entryNumber, PointOfServiceModel pointOfServiceModel) throws CommerceCartModificationException
updatePointOfServiceForCartEntry(de.hybris.platform.commerceservices.service.data.CommerceCartParameter)cartModel - the user's cart in sessionentryNumber - the cart entry numberpointOfServiceModel - the point of serviceCommerceCartModificationExceptionCommerceCartModification updatePointOfServiceForCartEntry(CommerceCartParameter parameters) throws CommerceCartModificationException
parameters - - A bean holding any number of additional parameters a client may want to pass to the method for
extension purposes, the attributes can be added to the bean via beans.xml in your extensionsCommerceCartModification objectCommerceCartModificationException@Deprecated CommerceCartModification updateToShippingModeForCartEntry(CartModel cartModel, long entryNumber) throws CommerceCartModificationException
updateToShippingModeForCartEntry(de.hybris.platform.commerceservices.service.data.CommerceCartParameter)cartModel - the user's cart in sessionentryNumber - the cart entry numberCommerceCartModificationExceptionCommerceCartModification updateToShippingModeForCartEntry(CommerceCartParameter parameters) throws CommerceCartModificationException
parameters - - A bean holding any number of additional parameters a client may want to pass to the method for
extension purposes, the attributes can be added to the bean via beans.xml in your extensionsCommerceCartModification objectCommerceCartModificationException@Deprecated long split(CartModel cartModel, long entryNumber) throws CommerceCartModificationException
split(de.hybris.platform.commerceservices.service.data.CommerceCartParameter)cartModel - the user's cart in sessionentryNumber - the cart entry numberCommerceCartModificationExceptionlong split(CommerceCartParameter parameters) throws CommerceCartModificationException
parameters - - A bean holding any number of additional parameters a client may want to pass to the method for
extension purposes, the attributes can be added to the bean via beans.xml in your extensionsCommerceCartModificationException@Deprecated CommerceCartRestoration restoreCart(CartModel oldCart) throws CommerceCartRestorationException
restoreCart(de.hybris.platform.commerceservices.service.data.CommerceCartParameter)oldCart - the old cart to restoreCommerceCartRestorationExceptionCommerceCartRestoration restoreCart(CommerceCartParameter parameters) throws CommerceCartRestorationException
parameters - - A bean holding any number of additional parameters a client may want to pass to the method for
extension purposes, the attributes can be added to the bean via beans.xml in your extensionsCommerceCartRestorationException - if any problems occur in restoring the cartCartModel getCartForGuidAndSiteAndUser(java.lang.String guid, BaseSiteModel site, UserModel user)
guid - a unique identifiersite - the current BaseSite - may not be nulluser - the current user - may not be nullCartModel getCartForGuidAndSite(java.lang.String guid, BaseSiteModel site)
guid - site - CartModel getCartForCodeAndUser(java.lang.String code, UserModel user)
code - user - java.util.List<CartModel> getCartsForSiteAndUser(BaseSiteModel site, UserModel user)
site - user - @Deprecated java.math.BigDecimal estimateTaxes(CartModel cartModel, java.lang.String deliveryZipCode, java.lang.String deliveryCountryIso)
estimateTaxes(de.hybris.platform.commerceservices.service.data.CommerceCartParameter)
instead.cartModel - cart to estimate taxes fordeliveryZipCode - zip code to use as the delivery addressdeliveryCountryIso - country isocode used as the delivery addressCommerceTaxEstimateResult estimateTaxes(CommerceCartParameter parameters)
parameters - A parameter object holding the following properties - cartModel cart to estimate taxes for -
deliveryZipCode zip code to use as the delivery address - deliveryCountryIso country iso code used as
the delivery address@Deprecated void removeStaleCarts(CartModel currentCart, BaseSiteModel baseSite, UserModel user)
removeStaleCarts(de.hybris.platform.commerceservices.service.data.CommerceCartParameter)
instead.currentCart - the current user's cartbaseSite - the current base siteuser - the current uservoid removeStaleCarts(CommerceCartParameter parameters)
parameters - a parameter object holding the following values - cart Users Cart - baseSite Current base site - user
Current uservoid mergeCarts(CartModel fromCart, CartModel toCart, java.util.List<CommerceCartModification> modifications) throws CommerceCartMergingException
fromCart - the cart to mergetoCart - the target cartmodifications - the list of modificationsCommerceCartMergingExceptionvoid configureCartEntry(CommerceCartParameter parameters) throws CommerceCartModificationException
parameters - cartentryNumberproductproductConfiguratorproductConfigurationCommerceCartModificationException - if product is not configurable or entry is invalidjava.lang.IllegalArgumentException - if configuration containsvoid updateCartMetadata(CommerceCartMetadataParameter parameter)
parameter - a bean holding any number of additional attributes a client may want to pass to the method for extension
purposes, the attributes can be added to the bean via beans.xml in your extensionsjava.lang.IllegalArgumentException - if any attributes fail validationIllegalQuoteStateException - if the cart is associated with a quote for which the operation cannot be performedCommerceCartModification removeEntryGroup(RemoveEntryGroupParameter parameters) throws CommerceCartModificationException
parameters - a parameter object containing all attributes needed for remove group from the cart
cart user's cartentryGroupNumber number of entry group to be removedenableHooks should the method hooks be executedCommerceCartModification objectCommerceCartModificationException - if related cart entry wasn't removed.Copyright © 2018 SAP SE. All Rights Reserved.