Class DefaultCartServiceForAccelerator
java.lang.Object
de.hybris.platform.servicelayer.internal.service.AbstractService
de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
de.hybris.platform.order.impl.DefaultAbstractOrderService<CartModel,CartEntryModel>
de.hybris.platform.order.impl.DefaultCartService
de.hybris.platform.acceleratorservices.order.impl.DefaultCartServiceForAccelerator
- All Implemented Interfaces:
AbstractOrderService<CartModel,,CartEntryModel> CartService,Serializable,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.InitializingBean
Override addNewEntry method from
AbstractOrderService for adding new entry/update entries to cart.- See Also:
-
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.order.impl.DefaultCartService
SESSION_CART_PARAMETER_NAMEFields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
modelService, sessionService, txManagerFields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
tenant -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddNewEntry(ComposedTypeModel entryType, CartModel order, ProductModel product, long qty, UnitModel unit, int number, boolean addToPresent) Adds a new entry of the givenComposedTypeModelto the given order.protected voidcheckQuantity(long qty, int number) protected AbstractOrderEntryModelgetAbstractOrderEntryModel(CartModel order, ProductModel product, long qty, int number, boolean addToPresent, UnitModel usedUnit) protected booleanisNotGiveAwayAndHasEqualUnit(CartEntryModel cartEntry, UnitModel usedUnit) protected booleanisPOSNotNullAndHasEqualEntryNumber(CartEntryModel cartEntry, int number) protected booleanisPOSNullAndAppendAsLast(CartEntryModel cartEntry, int number) Methods inherited from class de.hybris.platform.order.impl.DefaultCartService
addToCart, appendToCart, calculateCart, changeCurrentCartUser, changeSessionCartCurrency, clone, createCartFromQuote, getCreateCartFromQuoteStrategy, getNextEntryNumber, getSessionCart, hasCart, hasSessionCart, internalGetSessionCart, postProcessClonedEntries, removeSessionCart, setAddToCartStrategy, setCartFactory, setCreateCartFromQuoteStrategy, setOrderCalculation, setSessionCart, updateQuantities, updateQuantitiesMethods inherited from class de.hybris.platform.order.impl.DefaultAbstractOrderService
addAllGlobalDiscountValues, addAllTotalTaxValues, addEntryAtPosition, addGlobalDiscountValue, addNewEntry, addNewEntry, addTotalTaxValue, getAbstractOrderEntryService, getAbstractOrderEntryTypeService, getCloneAbstractOrderStrategy, getCollidingEntry, getEntriesForNumber, getEntriesForProduct, getEntryForNumber, getEntryTypeCode, getGlobalDiscountValue, getOrderDao, getSaveAbstractOrderStrategy, removeGlobalDiscountValue, removeTotalTaxValue, saveOrder, setAbstractOrderEntryService, setAbstractOrderEntryTypeService, setCloneAbstractOrderStrategy, setOrderDao, setSaveAbstractOrderStrategyMethods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
getModelService, getSessionService, getTxManager, setModelService, setSessionService, setTxManagerMethods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
afterPropertiesSet, getCurrentTenant, setBeanName, setCurrentTenant, writeReplaceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.hybris.platform.order.AbstractOrderService
addAllGlobalDiscountValues, addAllTotalTaxValues, addGlobalDiscountValue, addNewEntry, addNewEntry, addTotalTaxValue, getEntriesForNumber, getEntriesForProduct, getEntryForNumber, getGlobalDiscountValue, removeGlobalDiscountValue, removeTotalTaxValue, saveOrder
-
Constructor Details
-
DefaultCartServiceForAccelerator
public DefaultCartServiceForAccelerator()
-
-
Method Details
-
addNewEntry
public AbstractOrderEntryModel addNewEntry(ComposedTypeModel entryType, CartModel order, ProductModel product, long qty, UnitModel unit, int number, boolean addToPresent) Description copied from interface:AbstractOrderServiceAdds a new entry of the givenComposedTypeModelto the given order. The new entry is neither saved nor calculated. If your new entry has caused entries shuffling you may need to callAbstractOrderService.saveOrder(AbstractOrderModel)method in order to persist the changes.- Specified by:
addNewEntryin interfaceAbstractOrderService<CartModel,CartEntryModel> - Overrides:
addNewEntryin classDefaultAbstractOrderService<CartModel,CartEntryModel> - Parameters:
entryType- - the requested sub-type AbstractOrderEntryorder- - target orderproduct- -product to add, must not be nullqty- - quantityunit- - must not be nullnumber- - entry number of the new entry in the order. Entries are indexed starting from 0. Set number to -1 if you want to append the entry as the last one. You can request any non-negative position.addToPresent- - if true an existing entry with matching product and unit will get its quantity increased; otherwise a new entry is created- Returns:
AbstractOrderEntryModel- newly created order entry
-
getAbstractOrderEntryModel
protected AbstractOrderEntryModel getAbstractOrderEntryModel(CartModel order, ProductModel product, long qty, int number, boolean addToPresent, UnitModel usedUnit) -
isPOSNotNullAndHasEqualEntryNumber
-
isPOSNullAndAppendAsLast
-
isNotGiveAwayAndHasEqualUnit
-
checkQuantity
protected void checkQuantity(long qty, int number)
-