public class NonMergingUpdateCartStrategy
extends DefaultCommerceUpdateCartEntryStrategy
de.hybris.platform.commerceservices.order.impl.DefaultCommerceUpdateCartEntryStrategy| Constructor and Description |
|---|
NonMergingUpdateCartStrategy() |
| Modifier and Type | Method and Description |
|---|---|
protected Integer |
getEntryForProductAndPointOfService(CartModel cartModel,
ProductModel productModel,
PointOfServiceModel pointOfServiceModel) |
protected Optional<CartEntryModel> |
getMergeCandidate(CartModel cartModel,
ProductModel productModel,
PointOfServiceModel pointOfServiceModel,
Integer sampleEntryIndex) |
protected CommerceCartModification |
updateCartEntryDeliveryType(CommerceCartParameter parameters)
Change pickup location of cart entry.
|
CommerceCartModification |
updatePointOfServiceForCartEntry(CommerceCartParameter parameters)
Overrides updatePointOfServiceForCartEntry of DefaultCommerceUpdateCartEntryStrategy by
adding special logic for bundles.
|
CommerceCartModification |
updateToShippingModeForCartEntry(CommerceCartParameter parameters) |
public CommerceCartModification updatePointOfServiceForCartEntry(CommerceCartParameter parameters) throws CommerceCartModificationException
parameters - modification dataCommerceCartModificationExceptionpublic CommerceCartModification updateToShippingModeForCartEntry(CommerceCartParameter parameters) throws CommerceCartModificationException
CommerceCartModificationExceptionprotected CommerceCartModification updateCartEntryDeliveryType(CommerceCartParameter parameters) throws CommerceCartModificationException
Some changes may cause similar cart items to be. In that case the method will merge them, respecting bundle restrictions.
parameters - cart, entry number, POSCommerceCartModificationException - if entry is not editableprotected Optional<CartEntryModel> getMergeCandidate(CartModel cartModel, ProductModel productModel, PointOfServiceModel pointOfServiceModel, Integer sampleEntryIndex)
protected Integer getEntryForProductAndPointOfService(CartModel cartModel, ProductModel productModel, PointOfServiceModel pointOfServiceModel)
The override filters out bundle-related entries to prevent them from being merged.
More elegant would be to override orderEntryModifiableChecker with
bundleOrderEntryModifiableChecker globally -
then DefaultCommerceUpdateCartEntryStrategy#isOrderEntryUpdatable could take care of the filtration,
but commerceserivce treats 'cart item not modifiable' literally: no updates are allowed,
including any changes of BOPIS mode.
BundleOrderEntryModifiableCheckerCopyright © 2017 SAP SE. All Rights Reserved.