Class DefaultAddToCartStrategy
- java.lang.Object
-
- de.hybris.platform.servicelayer.internal.service.AbstractService
-
- de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
-
- de.hybris.platform.order.strategies.impl.DefaultAddToCartStrategy
-
- All Implemented Interfaces:
AddToCartStrategy
,java.io.Serializable
,org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanNameAware
,org.springframework.beans.factory.InitializingBean
public class DefaultAddToCartStrategy extends AbstractBusinessService implements AddToCartStrategy
Default implementation of theAddToCartStrategy
.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
AbstractService.SerializableDTO
-
-
Field Summary
-
Fields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
modelService, sessionService, txManager
-
Fields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
tenant
-
-
Constructor Summary
Constructors Constructor Description DefaultAddToCartStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addToCart(CartModel cart, ProductModel product, long quantity, UnitModel unit)
Deprecated.since agesvoid
setProductService(ProductService productService)
-
Methods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
getModelService, getSessionService, getTxManager, setModelService, setSessionService, setTxManager
-
Methods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
afterPropertiesSet, getCurrentTenant, setBeanName, setCurrentTenant, writeReplace
-
-
-
-
Method Detail
-
addToCart
@Deprecated public void addToCart(CartModel cart, ProductModel product, long quantity, UnitModel unit) throws InvalidCartException
Deprecated.since agesDescription copied from interface:AddToCartStrategy
Adds to the (existing)CartModel
the (existing)ProductModel
in the givenUnitModel
and with the givenquantity
. If in the cart already an entry with the given product and given unit exists the givenquantity
is added to the the quantity of this cart entry.- Specified by:
addToCart
in interfaceAddToCartStrategy
- Parameters:
cart
- the cart, must existproduct
- the product which is added to the cartquantity
- the quantity of the productunit
- ifnull
ProductService.getOrderableUnit(ProductModel)
is used to determine the unit- Throws:
InvalidCartException
- if theproduct
is a base product OR the quantity is less 1 or no usable unit was found (only when givenunit
is alsonull
)
-
setProductService
public void setProductService(ProductService productService)
-
-